@@ -131,9 +131,9 @@ public static string bin(object? number) {
131131 }
132132 }
133133
134- public static PythonType @bool => DynamicHelpers . GetPythonTypeFromType ( typeof ( bool ) ) ;
134+ public static PythonType @bool => TypeCache . Boolean ;
135135
136- public static PythonType bytes => DynamicHelpers . GetPythonTypeFromType ( typeof ( Bytes ) ) ;
136+ public static PythonType bytes => TypeCache . Bytes ;
137137
138138 public static PythonType bytearray => DynamicHelpers . GetPythonTypeFromType ( typeof ( ByteArray ) ) ;
139139
@@ -237,13 +237,13 @@ private static object CompileHelper(CodeContext/*!*/ context, SourceUnit sourceU
237237 ( object ) _ast . BuildAst ( context , sourceUnit , opts , mode ) ;
238238 }
239239
240- public static PythonType complex => DynamicHelpers . GetPythonTypeFromType ( typeof ( Complex ) ) ;
240+ public static PythonType complex => TypeCache . Complex ;
241241
242242 public static void delattr ( CodeContext /*!*/ context , object ? o , [ NotNone ] string name ) {
243243 PythonOps . DeleteAttr ( context , o , name ) ;
244244 }
245245
246- public static PythonType dict => DynamicHelpers . GetPythonTypeFromType ( typeof ( PythonDictionary ) ) ;
246+ public static PythonType dict => TypeCache . Dict ;
247247
248248 public static PythonList dir ( CodeContext /*!*/ context ) {
249249 PythonList res = new PythonList ( context . Dict . Keys ) ;
@@ -263,7 +263,7 @@ public static object divmod(CodeContext/*!*/ context, object? x, object? y) {
263263 return context . LanguageContext . DivMod ( x , y ) ;
264264 }
265265
266- public static PythonType enumerate => DynamicHelpers . GetPythonTypeFromType ( typeof ( Enumerate ) ) ;
266+ public static PythonType enumerate => TypeCache . Enumerate ;
267267
268268 internal static PythonDictionary ? GetAttrLocals ( CodeContext /*!*/ context , object ? locals ) {
269269 PythonDictionary ? attrLocals = null ;
@@ -380,12 +380,12 @@ public static void exec(CodeContext/*!*/ context, [NotNone] IBufferProtocol code
380380
381381 public static PythonType filter => DynamicHelpers . GetPythonTypeFromType ( typeof ( Filter ) ) ;
382382
383- public static PythonType @float => DynamicHelpers . GetPythonTypeFromType ( typeof ( double ) ) ;
383+ public static PythonType @float => TypeCache . Double ;
384384
385385 public static string format ( CodeContext /*!*/ context , object ? argValue , [ NotNone ] string formatSpec = "" )
386386 => PythonOps . Format ( context , argValue , formatSpec ) ;
387387
388- public static PythonType frozenset => DynamicHelpers . GetPythonTypeFromType ( typeof ( FrozenSetCollection ) ) ;
388+ public static PythonType frozenset => TypeCache . FrozenSet ;
389389
390390 public static object ? getattr ( CodeContext /*!*/ context , object ? o , [ NotNone ] string name ) {
391391 return PythonOps . GetBoundAttr ( context , o , name ) ;
@@ -633,7 +633,7 @@ public static object id(object? o) {
633633 return ( BigInteger ) res ;
634634 }
635635
636- public static PythonType @int => DynamicHelpers . GetPythonTypeFromType ( typeof ( BigInteger ) ) ;
636+ public static PythonType @int => TypeCache . BigInteger ;
637637
638638 public static bool isinstance ( object ? o , [ NotNone ] PythonType typeinfo ) {
639639 return PythonOps . IsInstance ( o , typeinfo ) ;
@@ -742,9 +742,9 @@ public static object len(object? o) {
742742 return PythonOps . Length ( o , out int res , out BigInteger bigRes ) ? ( object ) res : bigRes ;
743743 }
744744
745- public static PythonType set => DynamicHelpers . GetPythonTypeFromType ( typeof ( SetCollection ) ) ;
745+ public static PythonType set => TypeCache . Set ;
746746
747- public static PythonType list => DynamicHelpers . GetPythonTypeFromType ( typeof ( PythonList ) ) ;
747+ public static PythonType list => TypeCache . PythonList ;
748748
749749 public static object locals ( CodeContext /*!*/ context ) {
750750 PythonDictionary dict = context . Dict ;
@@ -1075,7 +1075,7 @@ public static object locals(CodeContext/*!*/ context) {
10751075 }
10761076 }
10771077
1078- public static PythonType @object => DynamicHelpers . GetPythonTypeFromType ( typeof ( object ) ) ;
1078+ public static PythonType @object => TypeCache . Object ;
10791079
10801080 public static string oct ( object ? number ) {
10811081 object index = PythonOps . Index ( number ) ;
@@ -1564,13 +1564,13 @@ public object? CurrentValue {
15641564
15651565 #endregion
15661566
1567- public static PythonType super => DynamicHelpers . GetPythonTypeFromType ( typeof ( Super ) ) ;
1567+ public static PythonType super => TypeCache . Super ;
15681568
1569- public static PythonType str => DynamicHelpers . GetPythonTypeFromType ( typeof ( string ) ) ;
1569+ public static PythonType str => TypeCache . String ;
15701570
1571- public static PythonType tuple => DynamicHelpers . GetPythonTypeFromType ( typeof ( PythonTuple ) ) ;
1571+ public static PythonType tuple => TypeCache . PythonTuple ;
15721572
1573- public static PythonType type => DynamicHelpers . GetPythonTypeFromType ( typeof ( PythonType ) ) ;
1573+ public static PythonType type => TypeCache . PythonType ;
15741574
15751575 [ Documentation ( "vars([object]) -> dictionary\n \n Without arguments, equivalent to locals().\n With an argument, equivalent to object.__dict__." ) ]
15761576 public static object vars ( CodeContext /*!*/ context ) {
@@ -1587,7 +1587,7 @@ public static object vars(CodeContext/*!*/ context) {
15871587
15881588 public static PythonType zip => DynamicHelpers . GetPythonTypeFromType ( typeof ( Zip ) ) ;
15891589
1590- public static PythonType BaseException => DynamicHelpers . GetPythonTypeFromType ( typeof ( PythonExceptions . BaseException ) ) ;
1590+ public static PythonType BaseException => TypeCache . BaseException ;
15911591
15921592 // OSError aliases
15931593 public static PythonType EnvironmentError => PythonExceptions . OSError ;
0 commit comments