An error occurred while fetching the assigned milestone of the selected merge_request.
Uniqueness of Data Type Instances
This MR refactors the type system to avoid multiple creation of data type instances by caching them. This improves the performance of comparing types, avoids unnecessary copies, and increases general efficiency of data type handling.
- Introduce the metaclass
PsTypeMeta
which keeps track of all existing instances of subclasses ofPsType
, and alters class instantiation to return existing instances instead of creating new ones - Refactor
__eq__
and__hash__
, which are now implemented inPsType
and use an__args__
method implemented by each instantiable subclass - Fix
constify
/deconstify
to no longer copy their arguments, but memoize their return values - Refactor and extend documentation of the type system to reflect the changes
Some minor additions come along:
- Move
create_type
fromtypes.quick
totypes.parsing
- Rename
types.basic_types
totypes.types
- Move
PsType
,constify
anddeconstify
totypes.meta
- Add an inheritance diagram to the type system documentation
Edited by Frederik Hennig
Merge request reports
Activity
Filter activity
assigned to @da15siwa
removed ongoing label
requested review from @holzer
added 3 commits
-
69504a34...4b24e9b8 - 2 commits from branch
backend-rework
- f59ccfeb - Merge branch 'backend-rework' into fhennig/unique-types
-
69504a34...4b24e9b8 - 2 commits from branch
removed review request for @holzer
requested review from @holzer
added 9 commits
-
fabbb472...536420be - 2 commits from branch
backend-rework
- e9ff21a3 - Hot fixes:
- a496b54f - Functions test cases
- 01d0f054 - remove comments
- b80a4c7c - Introduce custom type annotations for CFunction
- 9d3cc8d5 - Doc comments for CFunction
- fafe58ec - Introduce PsLiteral and PsLiteralExpr.
- 02d7aa1a - Merge branch 'ast_extensions' into fhennig/unique-types
Toggle commit list-
fabbb472...536420be - 2 commits from branch
Please register or sign in to reply