view roundup/anypy/sets_.py @ 4905:6e313bdf6b69 routing

routing: Add new roundup.web namespace with router component This branch is to untangle hardcoded Roundup URL scheme, make it more readable and customizable with extensions. Right now it doesn't seem possible to write extension that renders static HTML page at /about without modifying Roundup DB, and this web component should not depend on DB schema.
author anatoly techtonik <techtonik@gmail.com>
date Tue, 15 Jul 2014 13:33:43 +0300
parents 06af6d5bedbe
children
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/