[Python-Dev] isinstance() on old-style classes in Py 2.7
Guido van Rossum
guido at python.org
Tue Oct 21 20:22:34 CEST 2014
Hm. I've never been a fan of that. EIBTI and such...
On Tue, Oct 21, 2014 at 10:53 AM, Barry Warsaw <barry at python.org> wrote:
> On Oct 21, 2014, at 10:13 AM, Guido van Rossum wrote:
>
> >For new code, and whenever you have an opportunity to refactor old code,
> >you should use new-style classes, by inheriting your class from object (or
> >from another class that inherits from object).
>
> One nice way to do this module-globally is to set:
>
> __metaclass__ = type
>
> at the top of your file. Then when you're ready to drop Python 2, it's an
> easy clean up.
>
> Cheers,
> -Barry
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/guido%40python.org
>
--
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20141021/634500ec/attachment.html>
More information about the Python-Dev
mailing list