Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Get rid of flextype #47

@ghost

Description

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


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions