public static KnownTypes CreateDefault(PythonAnalyzer state, PythonTypeDatabase fallbackDb) { var res = new KnownTypes(); var fallback = fallbackDb.BuiltinModule; for (int value = 0; value < res._types.Length; ++value) { res._types[value] = (IPythonType)fallback.GetAnyMember( ((ITypeDatabaseReader)fallbackDb).GetBuiltinTypeName((BuiltinTypeId)value) ); } res.SetClassInfo(state); return res; }
public static KnownTypes Create(PythonAnalyzer state, PythonTypeDatabase fallbackDb) { var res = new KnownTypes(); var interpreter = state.Interpreter; var fallback = fallbackDb.BuiltinModule; for (int value = 0; value < res._types.Length; ++value) { try { res._types[value] = interpreter.GetBuiltinType((BuiltinTypeId)value); } catch (KeyNotFoundException) { res._types[value] = (IPythonType)fallback.GetAnyMember( ((ITypeDatabaseReader)fallbackDb).GetBuiltinTypeName((BuiltinTypeId)value) ); } } res.SetClassInfo(state); return res; }
public static KnownTypes Create(PythonAnalyzer state, PythonTypeDatabase fallbackDb) { var res = new KnownTypes(); var interpreter = state.Interpreter; var fallback = fallbackDb.BuiltinModule; for (int value = 0; value < res._types.Length; ++value) { try { res._types[value] = interpreter.GetBuiltinType((BuiltinTypeId)value); } catch (KeyNotFoundException) { res._types[value] = (IPythonType)fallback.GetAnyMember( ((ITypeDatabaseReader)fallbackDb).GetBuiltinTypeName((BuiltinTypeId)value) ); } } res.SetClassInfo(state); return(res); }