Uniqueness of Data Type Instances
Files
26+ 24
− 9
@@ -23,4 +32,10 @@ Data Type Abbreviations
@@ -23,4 +32,10 @@ Data Type Abbreviations
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.
PsTypeMeta
which keeps track of all existing instances of subclasses of PsType
, and alters class instantiation to return existing instances instead of creating new ones__eq__
and __hash__
, which are now implemented in PsType
and use an __args__
method implemented by each instantiable subclassconstify
/deconstify
to no longer copy their arguments, but memoize their return valuesSome minor additions come along:
create_type
from types.quick
to types.parsing
types.basic_types
to types.types
PsType
, constify
and deconstify
to types.meta