[Python-checkins] r55737 - peps/trunk/pep-3115.txt

guido.van.rossum python-checkins at python.org
Sat Jun 2 01:17:18 CEST 2007


Author: guido.van.rossum
Date: Sat Jun  2 01:17:14 2007
New Revision: 55737

Modified:
   peps/trunk/pep-3115.txt
Log:
Fix bugs in example found by Georg Brandl.


Modified: peps/trunk/pep-3115.txt
==============================================================================
--- peps/trunk/pep-3115.txt	(original)
+++ peps/trunk/pep-3115.txt	Sat Jun  2 01:17:14 2007
@@ -197,7 +197,7 @@
               self.member_names.append(key)
 
            # Call superclass
-           dict.setitem(self, key, value)
+           dict.__setitem__(self, key, value)
 
      # The metaclass
      class OrderedClass(type):
@@ -208,12 +208,12 @@
             return member_table()
 
          # The metaclass invocation
-         def __init__(self, name, bases, classdict):
+         def __new__(cls, name, bases, classdict):
             # Note that we replace the classdict with a regular
             # dict before passing it to the superclass, so that we
             # don't continue to record member names after the class
             # has been created.
-            result = type(name, bases, dict(classdict))
+            result = type.__new__(cls, name, bases, dict(classdict))
             result.member_names = classdict.member_names
             return result
 


More information about the Python-checkins mailing list