Re: [Python-Dev] Indentation oddness...

2009-06-01 Thread Robert Kern
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

Re: [Python-Dev] Indentation oddness...

2009-05-30 Thread Greg Ewing
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

Re: [Python-Dev] Indentation oddness...

2009-05-30 Thread Dino Viehland
> 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

Re: [Python-Dev] Indentation oddness...

2009-05-29 Thread Guido van Rossum
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

Re: [Python-Dev] Indentation oddness...

2009-05-29 Thread Dino Viehland
> 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

Re: [Python-Dev] Indentation oddness...

2009-05-29 Thread Robert Kern
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

[Python-Dev] Indentation oddness...

2009-05-29 Thread Dino Viehland
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

[Python-Dev] Indentation oddness...

2009-05-29 Thread Dino Viehland
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