MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / SymbolTableFactory

Class SymbolTableFactory

tools/python-3.11.9-amd64/Lib/symtable.py:21–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 return _newSymbolTable(top, filename)
20
21class SymbolTableFactory:
22 def __init__(self):
23 self.__memo = weakref.WeakValueDictionary()
24
25 def new(self, table, filename):
26 if table.type == _symtable.TYPE_FUNCTION:
27 return Function(table, filename)
28 if table.type == _symtable.TYPE_CLASS:
29 return Class(table, filename)
30 return SymbolTable(table, filename)
31
32 def __call__(self, table, filename):
33 key = table, filename
34 obj = self.__memo.get(key, None)
35 if obj is None:
36 obj = self.__memo[key] = self.new(table, filename)
37 return obj
38
39_newSymbolTable = SymbolTableFactory()
40

Callers 1

symtable.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected