injecting "set" into 2.3's builtins?

Skip Montanaro skip at pobox.com
Fri Mar 11 22:56:40 CET 2005


    >> I have:
    >> try:
    >>     set
    >> except NameError:
    >>     from sets import Set as set
    >> in my code in a few places.

    Sion> Is there any reason to prefer this over the idiom I have:

    Sion> if sys.version_info < (2, 4):
    Sion>     from sets import Set as set

No, actually, in my mind all this stuff is ugly.  I'd rather just inject
"set" into builtins using sitecustomize as long as it's unlikely to cause
problems.

Skip



More information about the Python-list mailing list