[pypy-issue] Issue #2639: PyPy3.5 should allow assigning to module object __class__ (pypy/pypy)

Nathaniel Smith issues-reply at bitbucket.org
Wed Aug 23 04:12:20 EDT 2017

New issue 2639: PyPy3.5 should allow assigning to module object __class__

Nathaniel Smith:

I was trying to use [`metamodule`](https://github.com/njsmith/metamodule) on pypy3 5.8.0, but it doesn't work: unlike CPython, you can't assign to module object's `__class__` attribute. This is a narrow exception to the normal "`__class__` assignment is only for heap types" rule that was added in CPython 3.5 – now the rule is "only heap types or modules". [CPython source.](https://github.com/python/cpython/blob/772d809a63f40fd35679da3fb115cdf7fa81bd20/Objects/typeobject.c#L3813-L3870)

PyPy should implement this too so I can deprecate module attributes :-)

More information about the pypy-issue mailing list