Fix the Enum constructor, and document the change

This commit is contained in:
Christophe de Vienne 2012-08-24 10:45:58 +02:00
parent 3ada92fbf1
commit b49f992d1d
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,9 @@ Changes
* RESTful protocol can now use the http method.
* UserTypes can now be given a name that will be used in the
documentation.
0.3 (2012-04-20)
----------------

View File

@ -134,7 +134,7 @@ class Enum(UserType):
def __init__(self, basetype, *values, **kw):
self.basetype = basetype
self.values = set(values)
name = kw.pop('name')
name = kw.pop('name', None)
if name is None:
name = "Enum(%s)" % ', '.join((str(v) for v in values))
self.name = name