MCPcopy Index your code
hub / github.com/python/cpython / SymbolTableFactory

Class SymbolTableFactory

Lib/symtable.py:29–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 return _newSymbolTable(top, filename)
28
29class SymbolTableFactory:
30 def __init__(self):
31 self.__memo = weakref.WeakValueDictionary()
32
33 def new(self, table, filename):
34 if table.type == _symtable.TYPE_FUNCTION:
35 return Function(table, filename)
36 if table.type == _symtable.TYPE_CLASS:
37 return Class(table, filename)
38 return SymbolTable(table, filename)
39
40 def __call__(self, table, filename):
41 key = table, filename
42 obj = self.__memo.get(key, None)
43 if obj is None:
44 obj = self.__memo[key] = self.new(table, filename)
45 return obj
46
47_newSymbolTable = SymbolTableFactory()
48

Callers 1

symtable.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…