Message164606
Section 3.3.3.2. "Preparing the class namespace" of the documentation (http://docs.python.org/dev/reference/datamodel.html#preparing-the-class-namespace) states that "If the metaclass has a __prepare__ attribute, it is called as ``namespace = metaclass.__prepare__(name, bases, **kwds)``...." This isn't quite true. By just defining a ``__prepare__`` method in a metaclass, the interpreter calls it as it would a static method -- there is no implicit first argument referring to ``metaclass`` as the documentation implies. The documentation should be amended to say that users can decorate ``__prepare__`` as a class method to get ``metaclass`` passed in as the implicit first argument. |
|
Date |
User |
Action |
Args |
2012-07-03 15:08:38 | William.Schwartz | set | recipients:
+ William.Schwartz, docs@python |
2012-07-03 15:08:38 | William.Schwartz | set | messageid: <1341328118.33.0.670602196671.issue15243@psf.upfronthosting.co.za> |
2012-07-03 15:08:37 | William.Schwartz | link | issue15243 messages |
2012-07-03 15:08:37 | William.Schwartz | create | |
|