A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-April/153100.html below:

[Python-Dev] PEP 573 -- Module State Access from C Extension Methods

[Python-Dev] PEP 573 -- Module State Access from C Extension Methods [Python-Dev] PEP 573 -- Module State Access from C Extension MethodsJeroen Demeyer J.Demeyer at UGent.be
Thu Apr 26 05:04:07 EDT 2018
> - In Python code, __objclass__ should be the defining class, not the module.

Indeed. My idea would be to add an accessor __parent__ returning the 
m_parent field (whatever it is) and then implement __objclass__ as 
something like:

@property
def __objclass__(self):
     parent = getattr(self, "__parent__", None)
     if isinstance(parent, type):
         return parent
     else:
         raise AttributeError

In PEP 575, I don't plan to add a Python attribute specifically for 
getting the defining module: I'll leave that to PEP 573.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4