Trying to understand Python objects

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Nov 21 20:29:25 EST 2006


Ben Finney <bignose+hates-spam at benfinney.id.au> writes:

> Or, the attributes are added to a specific instance (often in the
> initialisation method) so that each instance has a separate attribute
> with the same name::

The example here should have been::

    class Point(object):
        spam = 4
        def __init__(self):
            self.eggs = 2

-- 
 \      "For mad scientists who keep brains in jars, here's a tip: why |
  `\    not add a slice of lemon to each jar, for freshness?"  -- Jack |
_o__)                                                           Handey |
Ben Finney




More information about the Python-list mailing list