Re: [Python-3000] State of the object system

2006-05-26 Thread Jim Jewett
On 5/26/06, Michael Chermside <[EMAIL PROTECTED]> wrote: > On 5/18/06, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > Adding a > > method isprime() or iseven() to a subclass of int will suddenly be lost > > in the resulting object after an operation as long as it is not > > overwritten to return the

Re: [Python-3000] State of the object system

2006-05-26 Thread Michael Chermside
On 5/18/06, Kay Schluehr <[EMAIL PROTECTED]> wrote: > Michael Chermside schrieb: > > >Unfortunately, for implementation reasons you can't modify most > >built-in (and some user-defined) classes in this fashion: > > > > >>> int.func2 = func2 > > > > Traceback (most recent call last): > > Fil

Re: [Python-3000] State of the object system

2006-05-18 Thread Guido van Rossum
On 5/17/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Michael Chermside" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > However, this is more of a practice than a prohibition... it IS > > possible to modify existing classes in Python. > > If the class is defined/written in Pyth

Re: [Python-3000] State of the object system

2006-05-18 Thread Josiah Carlson
Kay Schluehr <[EMAIL PROTECTED]> wrote: > Terry Reedy schrieb: > >>Unfortunately, for implementation reasons you can't modify most > >>built-in (and some user-defined) classes in this fashion: > >> > >Being able to add Python-coded functions as methods of compiled C-coded > >types/classes (bu

Re: [Python-3000] State of the object system

2006-05-18 Thread Kay Schluehr
Terry Reedy schrieb: >>Unfortunately, for implementation reasons you can't modify most >>built-in (and some user-defined) classes in this fashion: >> >> > >Being able to add Python-coded functions as methods of compiled C-coded >types/classes (builting or otherwise) would require some wrappin

Re: [Python-3000] State of the object system

2006-05-17 Thread Kay Schluehr
Michael Chermside schrieb: >Unfortunately, for implementation reasons you can't modify most >built-in (and some user-defined) classes in this fashion: > > >>> int.func2 = func2 > > Traceback (most recent call last): > File "", line 1, in -toplevel- > int.func2 = func2 > TypeError:

Re: [Python-3000] State of the object system

2006-05-17 Thread Terry Reedy
"Michael Chermside" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > However, this is more of a practice than a prohibition... it IS > possible to modify existing classes in Python. If the class is defined/written in Python. > Unfortunately, for implementation reasons you can't mod

Re: [Python-3000] State of the object system

2006-05-17 Thread Georg Brandl
Michael Chermside wrote: >> ( BTW this signals the user that the object system is quite immature >> and early alpha. Maybe one should >> rethink commenting the current state of development all over the >> public docs? ) > > You are completely correct. The manual is misleading and makes the st

Re: [Python-3000] State of the object system

2006-05-17 Thread Michael Chermside
Kay Schluehr writes: > I wonder what is the current state of type/class unification i.e. > "new style classes"? > > The Python 2.5 library reference ( chapter 2.3 ) still states that > this issue is being "far from complete". The current state is this: Python has already introduced "new style

[Python-3000] State of the object system

2006-05-17 Thread Kay Schluehr
I wonder what is the current state of type/class unification i.e. "new style classes"? The Python 2.5 library reference ( chapter 2.3 ) still states that this issue is being "far from complete". ( BTW this signals the user that the object system is quite immature and early alpha. Maybe one shou