Commit cf37fdd3 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Call super class' __init__ method and hard define attributes.


git-svn-id: https://svn.erp5.org/repos/neo/trunk@1342 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 802aadb8
......@@ -103,6 +103,9 @@ class Enum(dict):
class Item(int):
_enum = None
_name = None
def __new__(cls, value):
instance = super(Enum.Item, cls).__new__(cls, value)
instance._enum = None
......@@ -123,6 +126,7 @@ class Enum(dict):
return int(self) == int(other)
def __init__(self):
dict.__init__(self)
for name in dir(self):
if not re.match('^[A-Z_]*$', name):
continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment