[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-14 Thread R. David Murray
R. David Murray added the comment: I might tweak a couple words for flow, but it looks good. I do wonder about the repetition of the bit about parenthesis or whitespace that now exists. I wonder if the first occurrence of it should now be dropped. --

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I am not a native English speaker, but Sreepriya's latest patch looks ok to me (I am not sure the link from classes.rst is useful, though). Sreepriya, have you already signed the contributor's agreement? Otherwise, you can sign it online at http://www.python.o

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-12 Thread Sreepriya Chalakkal
Changes by Sreepriya Chalakkal : Added file: http://bugs.python.org/file34382/doc4.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Replace 'The right way... with To look up an attribute on an integer literal, separate the literal from the period with either a space or parentheses. >>> 3 .__class__ >>> (5).__class__ -- ___

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-12 Thread Sreepriya Chalakkal
Changes by Sreepriya Chalakkal : Added file: http://bugs.python.org/file34375/doc3.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-11 Thread Sreepriya Chalakkal
Sreepriya Chalakkal added the comment: New patch after first review. -- Added file: http://bugs.python.org/file34355/doc2.patch ___ Python tracker ___ ___

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-03-11 Thread Sreepriya Chalakkal
Sreepriya Chalakkal added the comment: This is a patch that includes the faq. -- keywords: +patch nosy: +sreepriya Added file: http://bugs.python.org/file34352/doc1.patch ___ Python tracker

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-02-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree that the tutorial should somewhere make it clear (possibly with a FAQ link) that int literals must be parenthesized or spaced before .name attribute access because .name is parsed as (.)name. That is a consequence of float literals not requiring a frac

[issue20692] Tutorial section 9.4 and FAQ: how to call a method on an int

2014-02-21 Thread R. David Murray
R. David Murray added the comment: Upon consideration, I think you are right: we should add a FAQ and link it from the tutorial. -- resolution: invalid -> stage: committed/rejected -> needs patch status: closed -> open title: Tutorial section 9.4 -> Tutorial section 9.4 and FAQ: how to

[issue20692] Tutorial section 9.4

2014-02-19 Thread Jon Shemitz
Jon Shemitz added the comment: That makes sense. Perhaps, then, the tutorial should include the FAQ? (I can't be the only person who thought to try this.) On Wed, Feb 19, 2014 at 3:59 PM, R. David Murray wrote: > > R. David Murray added the comment: > > It's actually almost a FAQ at this point.

[issue20692] Tutorial section 9.4

2014-02-19 Thread R. David Murray
R. David Murray added the comment: It's actually almost a FAQ at this point. The answer is that because of the way the parser works (it's a relatively simple parser, and we want to keep it that way), the tokenizer sees the '.' as making the token a float, and '3.__class__' is not a valid floa

[issue20692] Tutorial section 9.4

2014-02-19 Thread Jon Shemitz
New submission from Jon Shemitz: The tutorial says "Each value is an object, and therefore has a class (also called its type). It is stored as object.__class__." So, I tried >>> 3.__class__ File "", line 1 3.__class__ ^ SyntaxError: invalid syntax Yet, "foo".__cl