MCPcopy
hub / github.com/fluentpython/example-code-2e / find

Method find

18-with-match/lispy/original/lispy.py:134–138  ·  view source on GitHub ↗

Find the innermost Env where var appears.

(self, var)

Source from the content-addressed store, hash-verified

132 % (to_string(parms), to_string(args)))
133 self.update(zip(parms,args))
134 def find(self, var):
135 "Find the innermost Env where var appears."
136 if var in self: return self
137 elif self.outer is None: raise LookupError(var)
138 else: return self.outer.find(var)
139
140def is_pair(x): return x != [] and isa(x, list)
141def cons(x, y): return [x]+y

Callers 9

evalFunction · 0.95
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80
__repr__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected