tabs and spaces in py3k

Discussion in 'Python' started by rurpy@yahoo.com, Dec 8, 2008.

  1. Guest

    The following code works under 2.6
    ----
    def foo():
    a = 1
    <.tab..>b = 1
    ----
    but results in a TabError in Python 3k

    File "x.py", line 3
    b = 3
    ^
    TabError: inconsistent use of tabs and spaces in indentation

    The py3k docs say the same thing as the 2.6 docs,
    namely that tabs are expanded to spaces prior to
    determining the line's indentation. (Language
    Ref, Lex Anal, Line Struct, Indentation)
    (I wish someone would put the section numbers
    back in the docs.) No mention of this change
    (that I noticed) in What's New or NEWS.txt.

    Do the Py3k docs need correction?
    , Dec 8, 2008
    #1
    1. Advertising

  2. Lie Ryan Guest

    On Sun, 07 Dec 2008 20:51:50 -0800, rurpy wrote:

    > Do the Py3k docs need correction?


    If I were the maintainer of the parser, I'd add something like this:

    tab_width = random.randint(0, 1000)
    Lie Ryan, Dec 8, 2008
    #2
    1. Advertising

  3. Guest

    On Dec 7, 8:51 pm, wrote:
    > The following code works under 2.6
    > ----
    > def foo():
    > a = 1
    > <.tab..>b = 1
    > ----
    > but results in a TabError in Python 3k
    >
    > File "x.py", line 3
    > b = 3
    > ^
    > TabError: inconsistent use of tabs and spaces in indentation
    >
    > The py3k docs say the same thing as the 2.6 docs,
    > namely that tabs are expanded to spaces prior to
    > determining the line's indentation. (Language
    > Ref, Lex Anal, Line Struct, Indentation)
    > (I wish someone would put the section numbers
    > back in the docs.) No mention of this change
    > (that I noticed) in What's New or NEWS.txt.
    >
    > Do the Py3k docs need correction?


    -tt option in python 2.x is now default in python 3.0.
    Apparently it got slipped from any documentation, including what's
    new.

    --Inyeol
    , Dec 8, 2008
    #3
  4. Terry Reedy Guest

    wrote:

    >> Do the Py3k docs need correction?

    >
    > -tt option in python 2.x is now default in python 3.0.
    > Apparently it got slipped from any documentation, including what's
    > new.


    http://bugs.python.org/issue4603
    Terry Reedy, Dec 8, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nospam
    Replies:
    2
    Views:
    5,141
    Joe Smith
    Jul 3, 2004
  2. Sandeep
    Replies:
    1
    Views:
    858
    Raymond DeCampo
    Jan 15, 2006
  3. qwweeeit
    Replies:
    2
    Views:
    630
    qwweeeit
    Dec 14, 2005
  4. rantingrick

    Tabs -vs- Spaces: Tabs should have won.

    rantingrick, Jul 16, 2011, in forum: Python
    Replies:
    95
    Views:
    1,779
    Roy Smith
    Jul 19, 2011
  5. John Kopanas
    Replies:
    2
    Views:
    258
    Gregory Brown
    Jan 29, 2007
Loading...

Share This Page