From songofacandy at gmail.com Sat Mar 5 03:19:52 2011 From: songofacandy at gmail.com (INADA Naoki) Date: Sat, 5 Mar 2011 11:19:52 +0900 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? Message-ID: In http://docs.python.org/py3k/tutorial/datastructures.html#comparing-sequences-and-other-types , The operators is and is notcompare whether two objects are really the same > object; > this only matters for mutable objects like lists. I think this notation may confuse readers of the tutorial. For example, pep8 recommands using is operator for immutable singleton objects like None. Shall we remove letter part? -- INADA Naoki -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at pearwood.info Sat Mar 5 04:13:53 2011 From: steve at pearwood.info (Steven D'Aprano) Date: Sat, 05 Mar 2011 14:13:53 +1100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: References: Message-ID: <4D71AA71.7090306@pearwood.info> INADA Naoki wrote: > In > http://docs.python.org/py3k/tutorial/datastructures.html#comparing-sequences-and-other-types > , > > The operators is and is notcompare whether two objects are really the same >> object; >> this only matters for mutable objects like lists. > > > I think this notation may confuse readers of the tutorial. For example, pep8 > recommands > using is operator for immutable singleton objects like None. > > Shall we remove letter part? Rather than completely remove it, I would reword it: The operators is and is not compare whether two objects are really the same object; this usually only matters for mutable objects like lists, or for testing against singletons like None. -- Steven From fdrake at acm.org Sat Mar 5 05:14:13 2011 From: fdrake at acm.org (Fred Drake) Date: Fri, 4 Mar 2011 23:14:13 -0500 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <4D71AA71.7090306@pearwood.info> References: <4D71AA71.7090306@pearwood.info> Message-ID: On Fri, Mar 4, 2011 at 10:13 PM, Steven D'Aprano wrote: > The operators is and is not compare whether two objects are really the same > object; this usually only matters for mutable objects like lists, or for > testing against singletons like None. I think having text about mutability here is confusing. Consider: >>> x = [] >>> a = x, >>> b = x, Here, a and b are different immutable objects, though they'll always be equal. "is" and "==" will produce different results; whether that matters is context-dependent. "==" will always return the *same* result as the list in x is mutated. Further: >>> c = [], >>> d = [], c and d are different objects, and their equality will vary as the contained lists are mutated. a, b, c and d are all immutable. So let's not condition the explanation with vague hints about when testing identity makes sense. I expect it will lead to more confusion than it will avoid. ? -Fred -- Fred L. Drake, Jr.? ? "A storm broke loose in my mind."? --Albert Einstein From songofacandy at gmail.com Sat Mar 5 06:30:51 2011 From: songofacandy at gmail.com (INADA Naoki) Date: Sat, 5 Mar 2011 14:30:51 +0900 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: References: <4D71AA71.7090306@pearwood.info> Message-ID: If detailed description is needed, my suggesting is: """ The operators?``is``?and?``is?not`` compare whether two objects are really the same object. Note that immutable objects having same value and type may be unified for efficiency. For example, ``'spam' is 'spam'`` is either ``True`` or ``False`` depending on Python implementation. Especially, singleton objects like ``True``, ``False``, ``None`` are always same object when thier type and value is same. """ This description may have to been splitted to separate paragraph. On Sat, Mar 5, 2011 at 1:14 PM, Fred Drake wrote: > > On Fri, Mar 4, 2011 at 10:13 PM, Steven D'Aprano wrote: > > The operators is and is not compare whether two objects are really the same > > object; this usually only matters for mutable objects like lists, or for > > testing against singletons like None. > > I think having text about mutability here is confusing. ?Consider: > > ? ?>>> x = [] > ? ?>>> a = x, > ? ?>>> b = x, > > Here, a and b are different immutable objects, though they'll always > be equal. ?"is" and "==" will produce different results; whether that > matters is context-dependent. ?"==" will always return the *same* > result as the list in x is mutated. > > Further: > > ? ?>>> c = [], > ? ?>>> d = [], > > c and d are different objects, and their equality will vary as the > contained lists are mutated. > > a, b, c and d are all immutable. > > So let's not condition the explanation with vague hints about when > testing identity makes sense. ?I expect it will lead to more confusion > than it will avoid. > > > ? -Fred > > -- > Fred L. Drake, Jr.? ? > "A storm broke loose in my mind."? --Albert Einstein > _______________________________________________ > Doc-SIG maillist ?- ?Doc-SIG at python.org > http://mail.python.org/mailman/listinfo/doc-sig -- INADA Naoki? From aahz at pythoncraft.com Sat Mar 5 18:06:22 2011 From: aahz at pythoncraft.com (Aahz) Date: Sat, 5 Mar 2011 09:06:22 -0800 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: References: <4D71AA71.7090306@pearwood.info> Message-ID: <20110305170621.GA6526@panix.com> On Sat, Mar 05, 2011, INADA Naoki wrote: > > If detailed description is needed, my suggesting is: > > """ > The operators ``is`` and ``is not`` compare whether two objects > are really the same object. Note that immutable objects having > same value and type may be unified for efficiency. For example, > ``'spam' is 'spam'`` is either ``True`` or ``False`` depending on > Python implementation. Especially, singleton objects like ``True``, > ``False``, ``None`` are always same object when thier type and value > is same. > """ +1 -- here's my rewrite for a bit more clarity: The operators ``is`` and ``is not`` compare whether two objects are really the same object (have the same memory location). Immutable objects with the same value and type may be cached to the same object for efficiency. For example, ``'spam' is 'spam'`` is either ``True`` or ``False`` depending on Python implementation. Singleton objects (``True``, ``False``, ``None``) are always the same object. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Programming language design is not a rational science. Most reasoning about it is at best rationalization of gut feelings, and at worst plain wrong." --GvR, python-ideas, 2009-03-01 From lac at openend.se Sat Mar 5 20:12:02 2011 From: lac at openend.se (Laura Creighton) Date: Sat, 05 Mar 2011 20:12:02 +0100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: Message from Aahz of "Sat, 05 Mar 2011 09:06:22 PST." <20110305170621.GA6526@panix.com> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> Message-ID: <201103051912.p25JC2Jm016053@theraft.openend.se> In a message of Sat, 05 Mar 2011 09:06:22 PST, Aahz writes: >+1 -- here's my rewrite for a bit more clarity: > >The operators ``is`` and ``is not`` compare whether two objects are >really the same object (have the same memory location). Immutable >objects with the same value and type may be cached to the same object for >efficiency. For example, ``'spam' is 'spam'`` is either ``True`` or >``False`` depending on Python implementation. Singleton objects >(``True``, ``False``, ``None``) are always the same object. I like Aahz's version. Laura From aahz at pythoncraft.com Sat Mar 5 20:21:20 2011 From: aahz at pythoncraft.com (Aahz) Date: Sat, 5 Mar 2011 11:21:20 -0800 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <1C806B69-3DCD-471C-AAE8-0BCC230A9499@valuestech.com> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <201103051912.p25JC2Jm016053@theraft.openend.se> <1C806B69-3DCD-471C-AAE8-0BCC230A9499@valuestech.com> Message-ID: <20110305192120.GA4346@panix.com> On Sat, Mar 05, 2011, Elva Castaneda de Hall wrote: > > Hello! > I am not sure how I ended up with a subscription to this virtual > conversation. I am not even sure where to go to unsubscribe. > > Rest assured I have no clue what is being discussed here. ; > ) > > Can someone tell me the website URL I can go to unsubscribe? Look at the bottom of this message. ;-) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Programming language design is not a rational science. Most reasoning about it is at best rationalization of gut feelings, and at worst plain wrong." --GvR, python-ideas, 2009-03-01 From elva at valuestech.com Sat Mar 5 20:16:08 2011 From: elva at valuestech.com (Elva Castaneda de Hall) Date: Sat, 5 Mar 2011 11:16:08 -0800 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <201103051912.p25JC2Jm016053@theraft.openend.se> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <201103051912.p25JC2Jm016053@theraft.openend.se> Message-ID: <1C806B69-3DCD-471C-AAE8-0BCC230A9499@valuestech.com> Hello! I am not sure how I ended up with a subscription to this virtual conversation. I am not even sure where to go to unsubscribe. Rest assured I have no clue what is being discussed here. ; > ) Can someone tell me the website URL I can go to unsubscribe? Thanks, e On Mar 5, 2011, at 11:12 AM, Laura Creighton wrote: > In a message of Sat, 05 Mar 2011 09:06:22 PST, Aahz writes: >> +1 -- here's my rewrite for a bit more clarity: >> >> The operators ``is`` and ``is not`` compare whether two objects are >> really the same object (have the same memory location). Immutable >> objects with the same value and type may be cached to the same >> object for >> efficiency. For example, ``'spam' is 'spam'`` is either ``True`` or >> ``False`` depending on Python implementation. Singleton objects >> (``True``, ``False``, ``None``) are always the same object. > > I like Aahz's version. > Laura > > _______________________________________________ > Doc-SIG maillist - Doc-SIG at python.org > http://mail.python.org/mailman/listinfo/doc-sig From steve at pearwood.info Sun Mar 6 00:59:55 2011 From: steve at pearwood.info (Steven D'Aprano) Date: Sun, 06 Mar 2011 10:59:55 +1100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <20110305170621.GA6526@panix.com> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> Message-ID: <4D72CE7B.2060700@pearwood.info> Aahz wrote: > The operators ``is`` and ``is not`` compare whether two objects are > really the same object (have the same memory location). Immutable > objects with the same value and type may be cached to the same object for > efficiency. For example, ``'spam' is 'spam'`` is either ``True`` or > ``False`` depending on Python implementation. Singleton objects > (``True``, ``False``, ``None``) are always the same object. Please remove the bit about the same memory location. That is an implementation detail which may be true for CPython, it may even be true for any sensible implementation of Python, but it's surely not a necessary condition for any language calling itself Python. I don't think it adds any clarity, since "same object" is a more intuitive concept than memory location (even non-programmers understand what it means to say that "my car" and "the car parked in the driveway" are the same object). And memory location is not something that Python the language exposes to the caller. Implementations with moving garbage collectors, such as PyPy and (I think) Jython, may move objects. All in all, I believe that Python's docs should stay as far away from any discussion of memory addresses as possible. It might be obvious to English speakers that ``is`` and ``is not`` do the opposite, but as it stands above, the documentation suggests that they are two different ways of writing the same thing. None, True and False are not the only singletons in Python, but the above gives the false impression of an exhaustive list. The more I think about this the more I agree with Fred Drake that we should keep this simple. The documentation for the ``is`` operator is not the place for a discussion of implementation-specific optimizations. The operator ``is`` tests whether the two operands are the same object. ``is not`` tests that they are different objects. If we have to mention singletons here, and I don't think we do, then a single example is enough: Singleton objects such as ``None`` are, by definition, always the same object. -- Steven From lac at openend.se Sun Mar 6 01:45:32 2011 From: lac at openend.se (Laura Creighton) Date: Sun, 06 Mar 2011 01:45:32 +0100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: Message from "Steven D'Aprano" of "Sun, 06 Mar 2011 10:59:55 +1100." <4D72CE7B.2060700@pearwood.info> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> Message-ID: <201103060045.p260jWlN013979@theraft.openend.se> In a message of Sun, 06 Mar 2011 10:59:55 +1100, "Steven D'Aprano" writes: >The more I think about this the more I agree with Fred Drake that we >should keep this simple. The documentation for the ``is`` operator is >not the place for a discussion of implementation-specific optimizations. > > The operator ``is`` tests whether the two operands are the > same object. ``is not`` tests that they are different objects. > >If we have to mention singletons here, and I don't think we do, then a >single example is enough: > > Singleton objects such as ``None`` are, by definition, > always the same object. > > > >-- >Steven While the point is well taken that objects that are the same do not have to occupy the same memory location, and don't in PyPy, the problem with explaining the 'is' and 'is not' operator is explaining what 'is the same object' means. I think the greatest cause of confusion is the fact that Cpython interns the intergers. Thus: [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = 5 >>> x == 5 True >>> x is 5 True while: Python 2.5.2 (e503e483e9ac, Dec 21 2010, 12:02:29) [PyPy 1.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``dystopian and utopian chairs'' >>>> x = 5 >>>> x == 5 True >>>> x is 5 False ------------------ So maybe what we need to do is to explictly state that some implementations have chosen to represent objects which are equivalent as the exact same object, but that you should not rely on this behaviour because it is an implementation detail? Laura From songofacandy at gmail.com Sun Mar 6 23:28:46 2011 From: songofacandy at gmail.com (INADA Naoki) Date: Mon, 7 Mar 2011 07:28:46 +0900 Subject: [Doc-SIG] Shouldn't tutorial follow the pep8? Message-ID: In http://docs.python.org/py3k/tutorial/classes.html#random-remarks > Possible conventions include capitalizing method names, prefixing > data attribute names with a small unique string (perhaps just an underscore), > or using verbs for methods and nouns for data attributes. Capitalizing methd names doesn't follows pep8. Many sample codes in tutorial doesn't follow pep8 too. For example, in http://docs.python.org/py3k/tutorial/introduction.html#numbers there are no spaces next to operators. -- INADA Naoki? From fuzzyman at voidspace.org.uk Sun Mar 6 23:56:53 2011 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 06 Mar 2011 22:56:53 +0000 Subject: [Doc-SIG] Shouldn't tutorial follow the pep8? In-Reply-To: References: Message-ID: <4D741135.3070005@voidspace.org.uk> On 06/03/2011 22:28, INADA Naoki wrote: > In http://docs.python.org/py3k/tutorial/classes.html#random-remarks > >> Possible conventions include capitalizing method names, prefixing >> data attribute names with a small unique string (perhaps just an underscore), >> or using verbs for methods and nouns for data attributes. > Capitalizing methd names doesn't follows pep8. > > Many sample codes in tutorial doesn't follow pep8 too. > For example, in http://docs.python.org/py3k/tutorial/introduction.html#numbers > there are no spaces next to operators. I believe a patch to the tutorial bringing it inline with pep 8 would be accepted (and a good thing). All the best, Michael -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html From lac at openend.se Mon Mar 7 00:08:38 2011 From: lac at openend.se (Laura Creighton) Date: Mon, 07 Mar 2011 00:08:38 +0100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: Message from "Steven D'Aprano" of "Sun, 06 Mar 2011 10:59:55 +1100." <4D72CE7B.2060700@pearwood.info> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> Message-ID: <201103062308.p26N8cjU003426@theraft.openend.se> I've been doing more thinking, and I think the problem is more deeply rooted than this. From the original doc: > The operators is and is not compare whether two objects are really the same > object; > this only matters for mutable objects like lists. This is actually wrong. If x is y, then you _aren't_ comparing two objects, you are comparing one object with itself, and that is the whole point. You are comparing two names, and seeing if they are bound to the same object. What I really want to tell the perplexed to do is read: http://effbot.org/zone/python-objects.htm However: Given that this is in the section on comparing sequences and other types: The operators ``is`` and ``is not`` test for object identity. If two different names are bound to the same object, then they compare the same: ``x is y`` . >>> v = [1,2,3] >>> w = v >>> v is w True >>> v.append(4) >>> v [1, 2, 3, 4] >>> w [1, 2, 3, 4] Confusion arises because implementors are free to cache immutable objects with the same value and type to the same object for reasons of efficiency. [PyPy 1.4.1] Type "help", "copyright", "credits" or "license" for more information. >>>> w = 1 >>>> y = 1 >>>> w is y False Python 2.6.6 #(I don't have a 3.x around , I assume it works the same way) Type "help", "copyright", "credits" or "license" for more information. >>> w = 1 >>> y = 1 >>> w is y # this might surprise you True Testing the object identity of unmutable objects with the ``is`` or ``is not`` operators is rarely something you want to do, because the result is implementation dependent. Singleton objects such as ``True``, ``False``, and ``None`` are always the same object. The canonical way to test whether an object is a singleton is to test for object identity, not equality. So >>> if x is None: ... do something ... not >>> if x == None: ... do something ... -------------- I think this will fix the confusion, but maybe it belongs someplace other than the comparing sequence section. http://docs.python.org/py3k/tutorial/datastructures.html#comparing-sequences-and-other-types From lac at openend.se Mon Mar 7 00:28:24 2011 From: lac at openend.se (Laura Creighton) Date: Mon, 07 Mar 2011 00:28:24 +0100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: Message from Laura Creighton of "Mon, 07 Mar 2011 00:08:38 +0100." <201103062308.p26N8cjU003426@theraft.openend.se> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> <201103062308.p26N8cjU003426@theraft.openend.se> Message-ID: <201103062328.p26NSOB6005353@theraft.openend.se> In a message of Mon, 07 Mar 2011 00:08:38 +0100, Laura Creighton writes: oops, that one escaped before I was done. The other point was that I wondered about the section title itself. 5.8. Comparing Sequences and Other Types This reads as if we are comparing types, when that is not what this section is about at all. Laura From ncoghlan at gmail.com Mon Mar 7 01:30:08 2011 From: ncoghlan at gmail.com (Nick Coghlan) Date: Mon, 7 Mar 2011 10:30:08 +1000 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <201103062308.p26N8cjU003426@theraft.openend.se> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> <201103062308.p26N8cjU003426@theraft.openend.se> Message-ID: On Mon, Mar 7, 2011 at 9:08 AM, Laura Creighton wrote: > Singleton objects such as ``True``, ``False``, and ``None`` are always > the same object. ?The canonical way to test whether an object is > a singleton is to test for object identity, not equality. ?So > >>>> if x is None: > ? ?... do something ... > > not > >>>> if x == None: > ? ?... do something ... Careful with that - "if x is True:" and "if x is False:" (along with s/is/==/) are almost always the wrong thing to do, but a reader could easily generalise the above to cover those two cases as well. Cheers, Nick. -- Nick Coghlan?? |?? ncoghlan at gmail.com?? |?? Brisbane, Australia From lac at openend.se Mon Mar 7 02:29:51 2011 From: lac at openend.se (Laura Creighton) Date: Mon, 07 Mar 2011 02:29:51 +0100 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: Message from Nick Coghlan of "Mon, 07 Mar 2011 10:30:08 +1000." References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> <201103062308.p26N8cjU003426@theraft.openend.se> Message-ID: <201103070129.p271TpM1016463@theraft.openend.se> In a message of Mon, 07 Mar 2011 10:30:08 +1000, Nick Coghlan writes: >On Mon, Mar 7, 2011 at 9:08 AM, Laura Creighton wrote: >> Singleton objects such as ``True``, ``False``, and ``None`` are always >> the same object. The canonical way to test whether an object is >> a singleton is to test for object identity, not equality. So: >> >>>>> if x is None: >> ... do something ... >> >> not >> >>>>> if x == None: >> ... do something ... > >Careful with that - "if x is True:" and "if x is False:" (along with >s/is/==/) are almost always the wrong thing to do, but a reader could >easily generalise the above to cover those two cases as well. > >Cheers, >Nick. Good point. Indeed, that may be where people who write code like that get the idea. I've always wondered. Ok. Change to: Testing the object identity of unmutable objects with the ``is`` or ``is not`` operators is rarely something you want to do, because the result is implementation dependent. But the canonical way to test whether an object is None is to test for object identity, not equality. so >>> if x is None: # this is how we write it ... do something ... not >>> if x == None: # don't do this. ... do something ... ----------- I figure that the fact that None is a singleton is not actually relevant to this. Laura From fdrake at acm.org Mon Mar 7 05:09:33 2011 From: fdrake at acm.org (Fred Drake) Date: Sun, 6 Mar 2011 23:09:33 -0500 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <201103060045.p260jWlN013979@theraft.openend.se> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> <201103060045.p260jWlN013979@theraft.openend.se> Message-ID: On Sat, Mar 5, 2011 at 7:45 PM, Laura Creighton wrote: > So maybe what we need to do is to explictly state that some implementations > have chosen to represent objects which are equivalent as the exact same > object, but that you should not rely on this behaviour because it is > an implementation detail? That still seems too complicated. Pointing out that equality does not imply identity, regardless of type, should be sufficient for the purpose of describing "is". ? -Fred -- Fred L. Drake, Jr.? ? "A storm broke loose in my mind."? --Albert Einstein From fdrake at acm.org Mon Mar 7 05:12:38 2011 From: fdrake at acm.org (Fred Drake) Date: Sun, 6 Mar 2011 23:12:38 -0500 Subject: [Doc-SIG] Does the "is" operator only matter for mutable object? In-Reply-To: <201103070129.p271TpM1016463@theraft.openend.se> References: <4D71AA71.7090306@pearwood.info> <20110305170621.GA6526@panix.com> <4D72CE7B.2060700@pearwood.info> <201103062308.p26N8cjU003426@theraft.openend.se> <201103070129.p271TpM1016463@theraft.openend.se> Message-ID: On Sun, Mar 6, 2011 at 8:29 PM, Laura Creighton wrote: > I figure that the fact that None is a singleton is not actually relevant > to this. It's important because Python promises that None is a singleton at the language level, rather than the implementation level. That's different than using cached values of small integers, since that's a runtime efficiency issue (and therefore implementation specific). That's essential to the recommended practice of testing for None using "is" rather than "=="; it's irrelevant to the general description of "is". ? -Fred -- Fred L. Drake, Jr.? ? "A storm broke loose in my mind."? --Albert Einstein From songofacandy at gmail.com Mon Mar 7 06:45:40 2011 From: songofacandy at gmail.com (INADA Naoki) Date: Mon, 7 Mar 2011 14:45:40 +0900 Subject: [Doc-SIG] Shouldn't tutorial follow the pep8? In-Reply-To: <4D741135.3070005@voidspace.org.uk> References: <4D741135.3070005@voidspace.org.uk> Message-ID: I've make a patch and post it to http://bugs.python.org/issue11425 On Mon, Mar 7, 2011 at 7:56 AM, Michael Foord wrote: > On 06/03/2011 22:28, INADA Naoki wrote: >> >> In http://docs.python.org/py3k/tutorial/classes.html#random-remarks >> >>> Possible conventions include capitalizing method names, prefixing >>> data attribute names with a small unique string (perhaps just an >>> underscore), >>> or using verbs for methods and nouns for data attributes. >> >> Capitalizing methd names doesn't follows pep8. >> >> Many sample codes in tutorial doesn't follow pep8 too. >> For example, in >> http://docs.python.org/py3k/tutorial/introduction.html#numbers >> there are no spaces next to operators. > > I believe a patch to the tutorial bringing it inline with pep 8 would be > accepted (and a good thing). > > All the best, > > Michael > > -- > http://www.voidspace.org.uk/ > > May you do good and not evil > May you find forgiveness for yourself and forgive others > May you share freely, never taking more than you give. > -- the sqlite blessing http://www.sqlite.org/different.html > > -- INADA Naoki?