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

noreply@sourceforge.net noreply@sourceforge.net
Fri, 08 Mar 2002 21:00:22 -0800


Bugs item #516532, was opened at 2002-02-12 18: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'


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

Comment By: Roeland Rengelink (rengelink)
Date: 2002-03-09 05:00

Message:
Logged In: YES 
user_id=302601

I think this is a duplicate of #503837

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

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