[Python-Dev] rationale for the no-new-features approach

Tony Meyer t-meyer at ihug.co.nz
Wed Mar 16 23:32:35 CET 2005


[Bob Ippolito]
>>>> try:
>>>>      set
>>>> except NameError:
>>>>      from sets import Set as set
>>>>
>>>> You don't need the rest.

[Skip Montanaro]
>>> Sure, but then pychecker bitches about a statement that appears to
>>> have no effect. ;-)

[Bob Ippolito]
>> Well then fix PyChecker to look for this pattern :)

+1.

[Gregory P. Smith]
> or make it even uglier to hide from pychecker by writing that as:
> 
> exec("""
> try:
>     set
> except NameError:
>     from sets import Set as set
> """)

I presume that was somewhat tongue-in-cheek, but if it wasn't, please
reconsider.  Modulefinder isn't able to realise that set (or sets.Set) is
needed with the latter (a problem of this very nature was just fixed with
bsddb), which causes trouble for people later on.

=Tony.Meyer



More information about the Python-Dev mailing list