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

Class Code

tools/python-3.11.9-amd64/Tools/scripts/umarshal.py:51–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class Code:
52 def __init__(self, **kwds: Any):
53 self.__dict__.update(kwds)
54
55 def __repr__(self) -> str:
56 return f"Code(**{self.__dict__})"
57
58 co_localsplusnames: Tuple[str]
59 co_localspluskinds: Tuple[int]
60
61 def get_localsplus_names(self, select_kind: int) -> Tuple[str, ...]:
62 varnames: list[str] = []
63 for name, kind in zip(self.co_localsplusnames,
64 self.co_localspluskinds):
65 if kind & select_kind:
66 varnames.append(name)
67 return tuple(varnames)
68
69 @property
70 def co_varnames(self) -> Tuple[str, ...]:
71 return self.get_localsplus_names(CO_FAST_LOCAL)
72
73 @property
74 def co_cellvars(self) -> Tuple[str, ...]:
75 return self.get_localsplus_names(CO_FAST_CELL)
76
77 @property
78 def co_freevars(self) -> Tuple[str, ...]:
79 return self.get_localsplus_names(CO_FAST_FREE)
80
81 @property
82 def co_nlocals(self) -> int:
83 return len(self.co_varnames)
84
85
86class Reader:

Callers 1

_r_objectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected