This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Retro
Recipients Retro, docs@python
Date 2011-02-25.12:25:14
SpamBayes Score 2.3207454e-09
Marked as misclassified No
Message-id <1298636715.79.0.945833742805.issue11318@psf.upfronthosting.co.za>
In-reply-to
Content
I have found a possible typo in an example code of Python 3.2. It's located on page 32 in the PDF version of the FAQ document. The code is:

class C:
    count = 0 # number of times C.__init__ called

def __init__(self):
    C.count = C.count + 1

def getcount(self):
    return C.count # or return self.count

The code block of the __init__ method is the thing that has the typo. Shouldn't  C.count = C.count + 1  be  c.count = C.count + 1 ?  Because the text after this code example says:

c.count also refers to C.count for any c such that isinstance(c, C) holds /.../.

How can c.count also refer to C.count if there is no c.count in the present code example in the FAQ of Python 3.2?

If this is a typo, please fix it for Python 3.2 and also for other Python versions with the same typo.

Else if this is not a typo, explain how can c.count refer to C.count if there is no c.count in the code example.
History
Date User Action Args
2011-02-25 12:25:15Retrosetrecipients: + Retro, docs@python
2011-02-25 12:25:15Retrosetmessageid: <1298636715.79.0.945833742805.issue11318@psf.upfronthosting.co.za>
2011-02-25 12:25:14Retrolinkissue11318 messages
2011-02-25 12:25:14Retrocreate