Really stupid question regarding PEP 252 and type/class unification

Marcin 'Qrczak' Kowalczyk qrczak at
Thu Aug 23 21:11:35 CEST 2001

Thu, 23 Aug 2001 17:59:04 +0100, Jacob Kaplan-Moss <jacobkm at> pisze:

> I think I see what Russel is getting at here... the point is, myInt
> is an instance of class MyInt when it is first created, but what
> if I want to change the value of myInt without modifying the class?

int is immutable, so I expect the int part of MyInt to be immutable.

If you want a mutable int, don't inherit but compose/delegate (I'm
not familiar with the terminology).

You can't replace the base object when inheriting from regular classes
either. For regular classes there is even no base object (the same
__dict__ is used).

 __("<  Marcin Kowalczyk * qrczak at
  ^^                      SYGNATURA ZASTĘPCZA

More information about the Python-list mailing list