Python class strangeitude

Erik Max Francis max at alcyone.com
Sat Aug 24 16:00:54 EDT 2002


"Mr. Neutron" wrote:

>         I have discovered a strange thing about Python. I have a
> class, we'll
> call it MyClass. MyClass is derived from MyClassBase.
> 
> Now I do this
> 
> Jimmy = MyClass(...)
> ...
> 
> Randy = MyClass(...)
> 
> And guess what? Jimmy and Randy are the same darn thing in memory!

Either you've made an error somewhere else along the line here, or
you're mistaken about the objects being identical (to check, see what
`Jimmy is Randy' evaluates to).  You'll have to show us more code for us
to tell you where.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.



More information about the Python-list mailing list