[Python-3000] Change to class construction?

Phillip J. Eby pje at telecommunity.com
Sun Jul 8 19:50:30 CEST 2007


At 11:55 AM 7/8/2007 +0300, Collin Winter wrote:
>On 7/7/07, Phillip J. Eby <pje at telecommunity.com> wrote:
>>Collin, where did you find this code in setuptools, btw?  I've been
>>looking around at other packages of mine where static class
>>initialization uses data structures like this, and I haven't found
>>any place where anything but the "in" clause of a comprehension
>>depends on class-scope variables.  So, if setuptools is the only one
>>of my libraries that does this, I'd have to agree with Guido that it
>>is indeed quite rare.  :)
>>
>>If I had to hazard a guess, I'd guess that it's in one of the
>>setuptools command classes that subclasses a distutils command, and
>>proceeds to muck around with the original options in some fashion.  I
>>just don't want to check all of them if you know which one it is.  :)
>
>Yep, it's in setuptools.command.install, lines 20-23 (setuptools v0.6c6).

Ah.  Yeah, no big deal to change it; 'new_commands' and '_nc' don't 
need to be attributes of the class, and so could just be done before 
the 'class:' statement.  I don't know why I even bothered with the 
_nc thing there, either.



More information about the Python-3000 mailing list