[pygobject] Amend previous enum wrapping commit to remove redundant setting of __info__ attribute.



commit 2c70beca9e76e4dc253453c556e6985ce59a3dd9
Author: Laszlo Pandy <lpandy src gnome org>
Date:   Mon Jan 17 16:17:25 2011 +0100

    Amend previous enum wrapping commit to remove redundant setting of __info__ attribute.

 gi/module.py |    2 +-
 gi/types.py  |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gi/module.py b/gi/module.py
index fcffba3..98d089a 100644
--- a/gi/module.py
+++ b/gi/module.py
@@ -106,7 +106,7 @@ class IntrospectionModule(object):
                     wrapper = enum_add(g_type)
                 elif g_type.is_a(gobject.TYPE_NONE):
                     # An enum with a GType of None is an enum without GType
-                    wrapper = type(info.get_name(), (Enum,), {'__info__': None})
+                    wrapper = type(info.get_name(), (Enum,), {})
                 else:
                     wrapper = flags_add(g_type)
 
diff --git a/gi/types.py b/gi/types.py
index 970f19c..ca302c7 100644
--- a/gi/types.py
+++ b/gi/types.py
@@ -216,9 +216,9 @@ class StructMeta(type, MetaClassHelper):
         cls._setup_constructors()
 
 class Enum(int):
-    # Subclasses should have their own __info__ attribute
-    # so that all Enums do not share the same gi type.
-    __info__ = None
+    # Only subclasses of this type should be instantiated.
+    # Each subclass requires an __info__ attribute,
+    # which is not declared here because enums do not share the same gi type.
     def __init__(self, value):
         int.__init__(value)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]