[Python-Dev] Callable, non-descriptor class attributes.

Terrence Cole list-sink at trainedmonkeystudios.org
Sun Mar 13 00:42:49 CET 2011


On Sat, 2011-03-12 at 12:49 +1300, Greg Ewing wrote:
> Thomas Wouters wrote:
> 
> >  2. Make CFunctions turn into methods in CPython (after a period of 
> > warning about the impending change, obviously.) The actual *usecase* for 
> > this is hard to envision
> 
> While not necessary for the case being discussed here, this would
> be a big help for Pyrex and Cython, where currently some awkward
> things have to be done to get a Python class with methods implemented
> in C.

Just so.  I implemented a new C-level function type for Melano[1] just 2
days ago so that I can have the descriptor slot set (and get
__defaults__, __kw_defaults__, __annotations__, and any other missing
details from PyFunction that I want or need).

[1] https://github.com/terrence2/melano



More information about the Python-Dev mailing list