Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ostso
on Sept 18, 2012
|
parent
|
context
|
favorite
| on:
Actually, you don't understand lexical scope
Perhaps mistercow means things like
def foo(): x = 5 def bar(): print x def baz(): x = 6 print x bar() baz() print x
Which prints 5, 6, 5. If baz tried to print x before assigning, it would be an UnboundLocalError.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: