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

[Python-3000] Keep new.instance?

2006-05-26 Thread Collin Winter
Going through and cleaning up failing tests in the p3yk branch... Is there any interest in keeping new.instance()? It's defined as equivalent to types.InstanceType, which is in turn defined as (effectively)... """ class _C: pass InstanceType = type(_C()) """ Since _C under Python 3 will be

Re: [Python-3000] Keep new.instance?

2006-05-26 Thread Guido van Rossum
It should be discarded. You can already create instances bypassing __init__ by calling __new__. On 5/26/06, Collin Winter <[EMAIL PROTECTED]> wrote: > Going through and cleaning up failing tests in the p3yk branch... > > Is there any interest in keeping new.instance()? It's defined as > equivalent

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] Keep new.instance?

2006-05-26 Thread Collin Winter
On 5/26/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > It should be discarded. You can already create instances bypassing > __init__ by calling __new__. SF patch #1495675 (http://python.org/sf/1495675) does the trick; I've assigned it to you. Collin Winter _

Re: [Python-3000] Keep new.instance?

2006-05-26 Thread Greg Ewing
Collin Winter wrote: > Is there interest in keeping new.instance()'s functionality (that is, > in allowing users to create instances of a type, bypassing __init__ in > the process)? Doesn't C.__new__ already do this for a new-style class C? -- Greg ___