Skip to content

Instantly share code, notes, and snippets.

@jorgenschaefer
Created October 19, 2013 18:11
Show Gist options
  • Select an option

  • Save jorgenschaefer/7059409 to your computer and use it in GitHub Desktop.

Select an option

Save jorgenschaefer/7059409 to your computer and use it in GitHub Desktop.
def foo():
print 23
# Now an empty line. In a REPL, Python does not know if the user
# finished the definition of the function foo, or if it will
# continue. So it assumes the empty line terminates the current
# open code block.
# In the REPL, this would now cause a "bad indentation" error,
# because the definition of foo() ended above. In an actual
# program, this works.
print 17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment