You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
The flextype module was an early approach to make method calls of classes
faster.
From the docstring in flextype.c :
"An extension type that supports cached virtual C methods"
Flextype is used for tasklets, channels and the stacklessmodule as the base type.
This was a very well working trick to make methods very fast, to override them
from C and from Python, with caching.
I think time is ripe to replace flextype by regular heaptypes, because Python has
good enough caching now.
Another use-case was the ability to define the stacklessmodule with module methods,
something that I thought was missing.
Meanwhile it is easy to create an object by using a class as a module surrogate
and expose some methods. In other words: Flextype is no longer necessary and should go away.
At the same time I think it makes sense to abandon stacklessmodule as it is and replace it by a _stackless module that implements the bare minimum necessary.
All the rest should be implemented in a stackless.py module that makes things
nicer and supplies methods etc.
The _stackless module should for instance hold the current tracing functions to make
them fast callable during a transfer. For retrieving those functions, there is no need for C code. Instead, the stackless.py module should provide a class and access functions to support introspection.
My goal:
turn as much C code into Python code as possible, unless speed is a concern
replace special code by builtin code as much as possible
Original comment byKristján Valur Jónsson (Bitbucket: krisvale, GitHub: kristjanvalur):
I agree.
I also think that the dynamic module attributes (e.g. stackless.current) should be deprecated, since I don't think any other python code uses this conceps. As they are, they can certainly be emulated using classes :)
It took me quite a bit to figure out what this was referring to,
since the given issue number is wrong, and the original commit
message I found through git blame lists a different, also wrong
issue number... see https://bugs.python.org/issue27122#msg279449
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Originally reported by: Anonymous
About Flextype
The flextype module was an early approach to make method calls of classes
faster.
From the docstring in flextype.c :
"An extension type that supports cached virtual C methods"
Flextype is used for tasklets, channels and the stacklessmodule as the base type.
This was a very well working trick to make methods very fast, to override them
from C and from Python, with caching.
I think time is ripe to replace flextype by regular heaptypes, because Python has
good enough caching now.
Another use-case was the ability to define the stacklessmodule with module methods,
something that I thought was missing.
Meanwhile it is easy to create an object by using a class as a module surrogate
and expose some methods. In other words: Flextype is no longer necessary and should go away.
At the same time I think it makes sense to abandon stacklessmodule as it is and replace it by a _stackless module that implements the bare minimum necessary.
All the rest should be implemented in a stackless.py module that makes things
nicer and supplies methods etc.
The _stackless module should for instance hold the current tracing functions to make
them fast callable during a transfer. For retrieving those functions, there is no need for C code. Instead, the stackless.py module should provide a class and access functions to support introspection.
My goal:
turn as much C code into Python code as possible, unless speed is a concern
replace special code by builtin code as much as possible
The text was updated successfully, but these errors were encountered: