[Python-3000] Keep new.instance?

Guido van Rossum guido at python.org
Fri May 26 19:13:34 CEST 2006


It should be discarded. You can already create instances bypassing
__init__ by calling __new__.

On 5/26/06, Collin Winter <collinw at gmail.com> 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 to types.InstanceType, which is in turn defined as
> (effectively)...
>
> """
> class _C:
>     pass
>
> InstanceType = type(_C())
> """
>
> Since _C under Python 3 will be new-style, type(_C()) is _C, not <type
> 'instance'> (as in 2.x).
>
> 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)?
>
> Collin Winter
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list