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
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
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
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
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
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:
"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
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
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
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
10 matches
Mail list logo