Allow subclassing of some types

Registered by Gustavo Carneiro

Currently, the generated python types are not allowed to be subclassed in Python.

Making python types subclassable involves adding an instance dictionary to them. This implies that tp_traverse needs to be implemented. In addition, the C/C++ object need to become inter-dependent, so that the instance state isn't lost when the python wrapper goes out of scope, but the C/C++ object is kept alive and to-python convertion is needed again at a later stage. This means that python reference counting will no longer be enough to delete the object.

In summary, making a class subclassable has a runtime cost, and therefore should be disabled by default.

Blueprint information

Status:
Complete
Approver:
Gustavo Carneiro
Priority:
Undefined
Drafter:
Gustavo Carneiro
Direction:
Needs approval
Assignee:
Gustavo Carneiro
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Gustavo Carneiro
Completed by
Gustavo Carneiro

Related branches

Sprints

Whiteboard

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.