view roundup/anypy/sets_.py @ 4377:b6f1aaba4827

Small documentation update regarding debugging aids: - doc/debugging.txt: removed HYPERDBDEBUG and HYPERDBTRACE and replaced it with the text for SENDMAILDEBUG from doc/developers.txt. A short code inspection showed that to be correct. - refered to debugging.txt from developers.txt to have one unique place for documenting debugging aids. - Clarified for SENDMAILDEBUG that no email will be send if it is set.
author Bernhard Reiter <Bernhard.Reiter@intevation.de>
date Mon, 10 May 2010 07:08:11 +0000
parents eddb82d0964c
children 06af6d5bedbe
line wrap: on
line source

"""
anypy.sets_: sets compatibility module

uses the built-in type 'set' if available, and thus avoids
deprecation warnings. Simple usage:

Change all
    from sets import Set
to
    from roundup.anypy.sets_ import set

and use 'set' instead of 'Set'.
To avoid unnecessary imports, you can:

    try:
        set
    except NameError:
        from roundup.anypy.sets_ import set

see:
http://docs.python.org/library/sets.html#comparison-to-the-built-in-set-types

"""

try:
    set = set                     # built-in since Python 2.4
except NameError, TypeError:
    from sets import Set as set   # deprecated as of Python 2.6

# vim: ts=8 sts=4 sw=4 si et

Roundup Issue Tracker: http://roundup-tracker.org/