A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-October/136704.html below:

[Python-Dev] isinstance() on old-style classes in Py 2.7

[Python-Dev] isinstance() on old-style classes in Py 2.7 [Python-Dev] isinstance() on old-style classes in Py 2.7Barry Warsaw barry at python.org
Tue Oct 21 19:53:52 CEST 2014
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4