[Python-bugs-list] [ python-Bugs-516532 ] cls.__module__ and metaclasses

noreply@sourceforge.net noreply@sourceforge.net
Tue, 12 Feb 2002 10:34:58 -0800


Bugs item #516532, was opened at 2002-02-12 10:34
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=516532&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: cls.__module__ and metaclasses

Initial Comment:
In the following the __module__ attribute is incorrect:

file foo.py:
---------------
class foo(object):
  class __metaclass__(type):
    def __new__(cls, name, bases, dict):
      return type.__new__(cls, name, bases, dict)
---------------
file bar.py:
---------------
import foo

class bar(foo.foo):
   pass
---------------
With these two files the following test prints
the wrong result:

>>> import bar
>>> bar.bar.__module__
'foo'


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=516532&group_id=5470