[Python-Dev] PEP 573 -- Module State Access from C Extension Methods (original) (raw)
Jeroen Demeyer J.Demeyer at UGent.be
Thu Apr 26 05:04:07 EDT 2018
- Previous message (by thread): [Python-Dev] PEP 573 -- Module State Access from C Extension Methods
- Next message (by thread): [Python-Dev] PEP 573 -- Module State Access from C Extension Methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- 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.
- Previous message (by thread): [Python-Dev] PEP 573 -- Module State Access from C Extension Methods
- Next message (by thread): [Python-Dev] PEP 573 -- Module State Access from C Extension Methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]