On 2009-05-30 21:02, Greg Ewing wrote:
Robert Kern wrote:
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.
All that m
Robert Kern wrote:
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.
All that means is that the REPL needs to keep re
> Cc: Robert Kern; python-dev@python.org
> Subject: Re: [Python-Dev] Indentation oddness...
>
> I usually append some extra newlines before passing a string to
> compile(). That's the usual work-around. There's probably a subtle bug
> in the tokenizer when reading from
I usually append some extra newlines before passing a string to
compile(). That's the usual work-around. There's probably a subtle bug
in the tokenizer when reading from a string -- if you find it, please
upload a patch to the tracker!
--Guido
On Fri, May 29, 2009 at 5:52 PM, Dino Viehland wrote
> 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 Indentatio
On 2009-05-29 19:08, Dino Viehland wrote:
Consider the code:
code = "def Foo():\n\npass\n\n "
This code is malformed in that the final indentation (2 spaces) does not agree
with the previous indentation of the pass statement (4 spaces). Or maybe it's
just fine if you take the blank lin
Consider the code:
code = "def Foo():\n\npass\n\n "
This code is malformed in that the final indentation (2 spaces) does not agree
with the previous indentation of the pass statement (4 spaces). Or maybe it's
just fine if you take the blank lines should be ignored statement from the docs
Consider the code:
code = "def Foo():\n\npass\n\n "
This code is malformed in that the final indentation (2 spaces) does not agree
with the previous indentation of the pass statement (4 spaces). Or maybe it's
just fine if you take the blank lines should be ignored statement from the docs