A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-May/089791.html below:

[Python-Dev] Indentation oddness...

[Python-Dev] Indentation oddness...Dino Viehland dinov at microsoft.com
Sat May 30 02:52:33 CEST 2009
> The 'single' mode, which is used for the REPL, is a bit different than
> 'exec',
> which is used for modules. This difference lets you insert "blank"
> lines of
> whitespace into a function definition without exiting the definition.
> Ending
> with a truly empty line does not cause the IndentationError, so the
> REPL can
> successfully compile the code, signaling that the user has finished
> typing the
> function.

Sorry, I probably should have mentioned this but it repros w/
compile(..., "exec") as well:

>>> code = "def  Foo():\n\n    pass\n\n  "
>>> compile(code, 'foo', 'exec')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "foo", line 5

IndentationError: unindent does not match any outer indentation level

It also repros when passing in PyCF_DONT_IMPLY_DEDENT for flags under
single and exec.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4