Author terry.reedy
Recipients Jon.Shemitz, docs@python, pitrou, r.david.murray, sreepriya, terry.reedy
Date 2014-03-14.19:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394824127.07.0.539805437636.issue20692@psf.upfronthosting.co.za>
In-reply-to
Content
I agree with Antoine about the particular cross-link and would drop that one. Is there somewhere earlier in the tutorial that discusses .attribute access? That would be the place to mention the ints and dotted names. Rather than a link, I would just mention that ints need to be separated from the period.

I also agree with David. Here is a condensed answer that I think says just what is needed.

---
This is because the Python parser sees an integer literal followed by a period as a float literal and a float literal followed by a name, 
``5. __class__``, is a syntax error. To look up an attribute on an integer literal, separate the integer from the period with either a space or parentheses.

    >>> 5 .__class__
    <class 'int'>
    >>> (5).__class__
    <type 'int'>
History
Date User Action Args
2014-03-14 19:08:47terry.reedysetrecipients: + terry.reedy, pitrou, r.david.murray, docs@python, Jon.Shemitz, sreepriya
2014-03-14 19:08:47terry.reedysetmessageid: <1394824127.07.0.539805437636.issue20692@psf.upfronthosting.co.za>
2014-03-14 19:08:47terry.reedylinkissue20692 messages
2014-03-14 19:08:46terry.reedycreate