diff -r fd53f083768c Doc/faq/programming.rst --- a/Doc/faq/programming.rst Sat Mar 08 21:40:29 2014 -0500 +++ b/Doc/faq/programming.rst Tue Mar 11 11:34:51 2014 +0100 @@ -1601,6 +1601,21 @@ 13891296 +.. _faq-int-type: + +I get an error when I use SomeInteger.__class__ +----------------------------------------------- + +Each value is an object and has a class called as type associated with it. +It is stored as ``object.__class__``. +It is important to take care of how to use integer literals to view its class. +Integer literals must be parenthesized or spaced before ``.name`` attribute +access because ``.name`` is parsed as ``(.)name``. +The tokenizer sees the '.' as making the token a float, and +``5.__class__`` is not a valid float token. You can either use it as +``(5).__class__`` or as ``5 .__class__``. + + Modules ======= diff -r fd53f083768c Doc/tutorial/classes.rst --- a/Doc/tutorial/classes.rst Sat Mar 08 21:40:29 2014 -0500 +++ b/Doc/tutorial/classes.rst Tue Mar 11 11:34:51 2014 +0100 @@ -470,6 +470,7 @@ Each value is an object, and therefore has a *class* (also called its *type*). It is stored as ``object.__class__``. +See also :ref: `faq-int-type` .. _tut-inheritance: