Issue1789137

classification
Title: Patch for 1781500 (metaclasses and __module__)
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, leosoto
Priority: normal Keywords: patch

Created on 2007-09-06.04:57:57 by leosoto, last changed 2007-10-06.05:29:13 by cgroves.

Files
File name Uploaded Description Edit Remove
__module__.diff leosoto, 2007-09-06.04:57:57
class_module_attribute_test.patch leosoto, 2007-09-25.00:44:27 test case (for Lib/test/)
Messages
msg2879 (view) Author: Leonardo Soto (leosoto) Date: 2007-09-06.04:57:57
The idea is to set the __module__ on the class dict as soon as possible (Py.makeClass) instead of waiting for class instantiation (PyClass.init), as the later happens after metaclass invocation.
msg2880 (view) Author: Leonardo Soto (leosoto) Date: 2007-09-25.00:44:27
The bug also implies that every class with a metaclass living in another module get a wrong __module__ (that's because they get the __module__ where the metaclass is defined). A test case for this condition is attached.
File Added: class_module_attribute_test.patch
msg2881 (view) Author: Charlie Groves (cgroves) Date: 2007-10-06.05:29:13
Committed to trunk in r3572.  Thanks!
History
Date User Action Args
2007-09-06 04:57:57leosotocreate