Author novalis_dt
Recipients nnorwitz, novalis_dt, rhettinger, thomaslee
Date 2008-11-07.16:25:08
SpamBayes Score 6.78169e-11
Marked as misclassified No
Message-id <>
> FWIW, I see exposing bytecodes as an anti-pattern that locks in a
> particular implementation in a way that makes it hard to change and 
> hard to port to other Python implementations.  The current bound 
> method approach works fine.  Don't really see enough payoff to 
> justify the extra code and maintenance.

Bytecodes aren't exposed at the language level -- just during
compilation.  As far as I know, other implementations don't use any of
the Python compiler mechanics, so there's no portability problem.  If
another compiler did use the Python AST, they could just compile the
Append node kind to a method call with no loss of speed or clarity.  Or
they could just not use this optimization, if we refactor the ast
optimizer as I propose to use the strategy pattern.

As for the payoff, microbenchmarks show a big win.  Also, appending to a
list is a fairly common pattern.  Our Plone-based codebase shows tens of
thousands of instances of append.
Date User Action Args
2008-11-07 16:25:26novalis_dtsetrecipients: + novalis_dt, nnorwitz, rhettinger, thomaslee
2008-11-07 16:25:26novalis_dtsetmessageid: <>
2008-11-07 16:25:10novalis_dtlinkissue4264 messages
2008-11-07 16:25:08novalis_dtcreate