Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #42861
| Path | csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <isaac.to@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'level,': 0.07; 'exception.': 0.09; 'impose': 0.09; 'lead,': 0.09; 'spaces': 0.09; 'things,': 0.09; 'unittest': 0.09; 'python': 0.11; 'def': 0.12; 'col': 0.16; 'indent': 0.16; 'of)': 0.16; 'tab': 0.16; 'tabs': 0.16; 'to:name:python list': 0.16; '\xa0you': 0.16; 'sat,': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'starts': 0.20; 'import': 0.22; 'email addr:gmail.com>': 0.22; '(or': 0.24; 'options': 0.25; 'script': 0.25; '>': 0.26; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'am,': 0.29; "doesn't": 0.30; 'mix': 0.30; 'skip:& 60': 0.30; 'statement': 0.30; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'lines': 0.31; 'indentation': 0.31; 'writes:': 0.31; 'file': 0.32; 'class': 0.32; 'subject:all': 0.32; 'run': 0.32; 'url:python': 0.33; 'level.': 0.33; "i'd": 0.34; "can't": 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'next': 0.36; 'url:org': 0.36; 'should': 0.36; 'so,': 0.37; 'level': 0.37; 'starting': 0.37; 'being': 0.38; 'others.': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'skip:& 20': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'free': 0.61; 'john': 0.61; 'simple': 0.61; 'first': 0.61; "you'll": 0.62; 'email addr:gmail.com': 0.63; 'kind': 0.63; 'soon': 0.63; 'map': 0.64; 'more': 0.64; 'subject:you': 0.87; 'luck': 0.93; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=iPrx+2tx6FkA+3c9u6Av+3caqVnsgFEr9WjrW9Ut9ug=; b=DCxGNXmIMoDomHrRA1PUyKGyDQ1nKA+1tKshi62dGKrkTcE7VdhAFDqUJlxrOuSajA Ivo8IXatO5/iOTj3STBjXXF+Yn8R8Pd5vJHJgap8+hbReveDhgVuH3T1tSX4/G5aAVy+ s3p9aoZ8MAxlLHuUMcAs4pW9fzR8jIZJ99Afo7i/2mnWhvnXTk/g+001sxDaxN/MbNsn jwPud2XSe9ZptnNFgrLUW8MzoilKOaUbcB4gv7IM8D3qicdex7qlepWMBsAdd64V+Jag TJca+hs3pma7xkgAp6DbsPiuAqMxwSwCeGK3RPdM5sPvzkMCnV6Q9vp3Oy7cePAWHHKN Q4/Q== |
| MIME-Version | 1.0 |
| X-Received | by 10.229.92.132 with SMTP id r4mr3238790qcm.31.1365201342805; Fri, 05 Apr 2013 15:35:42 -0700 (PDT) |
| In-Reply-To | <906d8c05-99dc-4209-854c-7988ca7c78e3@googlegroups.com> |
| References | <64d4fb7c-6a75-4b5f-b5c8-06a4b2b5d0cb@googlegroups.com> <kjnh8h$pg5$1@reader1.panix.com> <906d8c05-99dc-4209-854c-7988ca7c78e3@googlegroups.com> |
| Date | Sat, 6 Apr 2013 06:35:42 +0800 |
| Subject | Re: I hate you all |
| From | Isaac To <isaac.to@gmail.com> |
| To | Python List <python-list@python.org> |
| Content-Type | multipart/alternative; boundary=14dae94ee1c715bb3104d9a4b5c4 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.166.1365201840.3114.python-list@python.org> (permalink) |
| Lines | 127 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1365201840 news.xs4all.nl 6953 [2001:888:2000:d::a6]:47323 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:42861 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
You underestimated the arrogance of Python. Python 3 tab doesn't map to 4 spaces. It doesn't map to any number of spaces. Tabs and spaces are completely unrelated. If you have a function having the first indentation level with 4 (or any number of) spaces, the next line starting not with 4 spaces but instead with a tab always lead you to the TabError exception. If you like to play tricks, you can use "4 spaces plus a tab" as the next indentation level. I'd rather not do this kind of things, and forget about use using tabs at all. You are out of luck if you want to play the tab-space tricks, but if you follow the lead, you'll soon find that code will be more reliable without tabs, especially if you cut-and-paste code of others. On Sat, Apr 6, 2013 at 6:04 AM, <terminatorul@gmail.com> wrote: > On Saturday, April 6, 2013 12:55:29 AM UTC+3, John Gordon wrote: > > In <64d4fb7c-6a75-4b5f-b5c8-06a4b2b5d0cb@googlegroups.com> > terminatorul@gmail.com writes: > > > > > How can python authors be so arrogant to impose their tabs and spaces > > > options on me ? It should be my choice if I want to use tabs or not ! > > > > You are free to use tabs, but you must be consistent. You can't mix > > tabs and spaces for lines of code at the same indentation level. > > They say so, but python does not work that way. This is a simple script: > > from unittest import TestCase > > class SvnExternalCmdTests(TestCase) : > def test_parse_svn_external(self) : > for sample_external in sample_svn_externals : > self.assertEqual(parse_svn_externals(sample_external[0][0], > sample_external[0][1]), [ sample_external[1] ]) > > And at the `for` statement at line 5 I get: > > C:\Documents and Settings\Adrian\Projects>python sample-py3.py > File "sample-py3.py", line 5 > for sample_external in sample_svn_externals : > ^ > TabError: inconsistent use of tabs and spaces in indentation > > > Line 5 is the only line in the file that starts at col 9 (after a tab). > Being the only line in the file with that indent level, how can it be > inconsistent ? > > You can try the script as it is, and see python 3.3 will not run it > -- > http://mail.python.org/mailman/listinfo/python-list >
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I hate you all terminatorul@gmail.com - 2013-04-05 14:41 -0700
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-06 08:53 +1100
Re: I hate you all John Gordon <gordon@panix.com> - 2013-04-05 21:55 +0000
Re: I hate you all terminatorul@gmail.com - 2013-04-05 15:04 -0700
Re: I hate you all Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-05 17:28 -0500
Re: I hate you all Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-05 16:42 -0600
Re: I hate you all terminatorul@gmail.com - 2013-04-05 17:22 -0700
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-06 11:35 +1100
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 08:07 +0300
Re: I hate you all Benjamin Kaplan <benjamin.kaplan@case.edu> - 2013-04-05 22:28 -0700
Re: I hate you all Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-05 23:53 -0600
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 09:56 +0300
Re: I hate you all Joshua Landau <joshua.landau.ws@gmail.com> - 2013-04-06 11:17 +0100
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 17:22 +0300
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-06 15:30 +0000
Re: I hate you all Roland Koebler <r.koebler@yahoo.de> - 2013-04-08 00:52 +0200
Re: I hate you all Michael Torrie <torriem@gmail.com> - 2013-04-05 23:59 -0600
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-06 06:19 +0000
Re: I hate you all Michael Torrie <torriem@gmail.com> - 2013-04-05 23:49 -0600
Re: I hate you all Andrew Berg <bahamutzero8825@gmail.com> - 2013-04-05 19:50 -0500
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-06 02:07 +0000
Re: I hate you all Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-05 21:53 -0600
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 08:36 +0300
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-06 16:44 +1100
Re: I hate you all Michael Torrie <torriem@gmail.com> - 2013-04-05 23:58 -0600
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 10:07 +0300
Re: I hate you all Ethan Furman <ethan@stoneleaf.us> - 2013-04-05 23:00 -0700
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-06 15:37 +0000
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-06 11:49 -0400
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-06 06:55 +0000
Re: I hate you all Larry Hudson <orgnut@yahoo.com> - 2013-04-06 13:17 -0700
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-07 14:37 +0300
Re: I hate you all Nobody <nobody@nowhere.com> - 2013-04-06 14:52 +0100
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-07 01:20 +1100
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-06 17:37 +0300
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-06 11:01 -0400
Re: I hate you all Neil Cerutti <neilc@norwich.edu> - 2013-04-06 15:15 +0000
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-06 15:41 +0000
Re: I hate you all rusi <rustompmody@gmail.com> - 2013-04-06 09:00 -0700
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-06 11:59 -0400
Re: I hate you all Neil Cerutti <neilc@norwich.edu> - 2013-04-06 18:48 +0000
Re: I hate you all rusi <rustompmody@gmail.com> - 2013-04-06 08:31 -0700
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-07 07:29 +1000
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-07 01:38 +0000
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-07 01:30 +0000
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-06 22:15 -0400
Re: I hate you all Jason Friedman <jsf80238@gmail.com> - 2013-04-06 20:42 -0600
Re: I hate you all Nobody <nobody@nowhere.com> - 2013-04-08 19:43 +0100
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-08 19:48 +0000
Re: I hate you all Walter Hurry <walterhurry@lavabit.com> - 2013-04-08 21:25 +0000
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-08 21:29 +0000
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-09 08:00 +1000
Re: I hate you all Walter Hurry <walterhurry@lavabit.com> - 2013-04-08 22:51 +0000
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-09 08:57 +1000
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-09 09:33 +0100
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-09 13:39 +0000
Re: I hate you all Tim Chase <python.list@tim.thechases.com> - 2013-04-09 09:17 -0500
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-10 00:20 +1000
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-09 16:51 +0100
Re: I hate you all Walter Hurry <walterhurry@lavabit.com> - 2013-04-09 21:09 +0000
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-09 23:09 +0100
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-09 23:21 +0000
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-10 09:28 +1000
Re: I hate you all Walter Hurry <walterhurry@lavabit.com> - 2013-04-09 23:50 +0000
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-10 10:31 +1000
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-10 02:00 +0000
Re: I hate you all Chris Angelico <rosuav@gmail.com> - 2013-04-10 12:14 +1000
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-10 00:39 +0100
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-10 00:41 +0100
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-09 21:43 +0000
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-09 02:51 +0000
Re: I hate you all rusi <rustompmody@gmail.com> - 2013-04-08 21:06 -0700
Re: I hate you all rusi <rustompmody@gmail.com> - 2013-04-08 21:52 -0700
Re: I hate you all Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-09 05:19 +0000
Re: I hate you all "Günther Dietrich" <gd.usenet@spamfence.net> - 2013-04-06 14:55 +0200
Re: I hate you all terminatorul@gmail.com - 2013-04-05 17:22 -0700
Re: I hate you all Isaac To <isaac.to@gmail.com> - 2013-04-06 06:35 +0800
Re: I hate you all Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-05 17:00 -0600
Re: I hate you all Dylan Evans <dylan@dje.me> - 2013-04-06 14:28 +1000
Re: I hate you all terminatorul@gmail.com - 2013-04-05 22:13 -0700
Re: I hate you all Dylan Evans <dylan@dje.me> - 2013-04-07 13:00 +1000
Re: I hate you all Timothy Madden <terminatorul@gmail.com> - 2013-04-07 14:44 +0300
Re: I hate you all Ethan Furman <ethan@stoneleaf.us> - 2013-04-07 11:12 -0700
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-07 14:33 -0400
Re: I hate you all terminatorul@gmail.com - 2013-04-05 22:13 -0700
Re: I hate you all Grant Edwards <invalid@invalid.invalid> - 2013-04-06 15:27 +0000
Re: I hate you all Roy Smith <roy@panix.com> - 2013-04-06 11:58 -0400
Re: I hate you all Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-07 19:25 +0100
csiph-web