[Python-Dev] Adding types.build_class for 3.3

R. David Murray rdmurray at bitdance.com
Fri May 11 17:36:35 CEST 2012


On Fri, 11 May 2012 10:16:42 -0400, Terry Reedy <tjreedy at udel.edu> wrote:
> On 5/11/2012 2:21 AM, Mark Shannon wrote:
> > +1 to a pure Python version.
> 
> Since new_class would be used rarely and not in inner loops, and (if I 
> understand) should mostly contain branching logic rather than looping, 
> speed hardly seems an issue.

Well, actually, the proposed new email policy is doing dynamic class
construction for any header accessed by the application, which could
potentially be every header in every message processed by an application
if refold_source is set true.  That's not quite an "inner loop", but it
isn't an outer one either.

That said, the header parsing logic that is also invoked by the process
of returning a header under the new policy is going to outweigh the
class construction overhead, I'm pretty sure.

--David


More information about the Python-Dev mailing list