public AstPythonInterpreter(AstPythonInterpreterFactory factory) { _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _factory.ImportableModulesChanged += Factory_ImportableModulesChanged; _modules = new ConcurrentDictionary <string, IPythonModule>(); _builtinTypes = new Dictionary <BuiltinTypeId, IPythonType>(); BuiltinModuleName = _factory.LanguageVersion.Is3x() ? SharedDatabaseState.BuiltinName3x : SharedDatabaseState.BuiltinName2x; _noneType = new AstPythonBuiltinType("NoneType", BuiltinTypeId.NoneType); _builtinTypes[BuiltinTypeId.NoneType] = _noneType; }
public AstPythonInterpreter(AstPythonInterpreterFactory factory, AnalysisLogWriter log = null) { _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _log = log; _factory.ImportableModulesChanged += Factory_ImportableModulesChanged; _modules = new ConcurrentDictionary <string, IPythonModule>(); _builtinTypes = new Dictionary <BuiltinTypeId, IPythonType>(); _noneType = new AstPythonBuiltinType("NoneType", BuiltinTypeId.NoneType); _builtinTypes[BuiltinTypeId.NoneType] = _noneType; _builtinTypes[BuiltinTypeId.Unknown] = new AstPythonBuiltinType("Unknown", BuiltinTypeId.Unknown); }