3 ms·
On the AST level, you have symbol names, so they become ambiguous. E.g. @inline def f(y): x = y + 1 return x def g(): x =
by albertzeyer 13y ago
On the AST level, you have symbol names, so they become ambiguous. E.g.
@inline
def f(y):
x = y + 1
return x
def g():
x = 42
f(0)
return x
print g()
would print 1.
When you do it on the bytecode level, many things probably would work, although I don't know whether some things might get confused when there are multiple variables with the same name. Also, accessing `locals()` would (of course) not work.
- masklinn 13y agoYes but that has nothing to do with the stack, it has to do with namespace conflicts between local variables.