3 ms·
New-style classes never became the default in Python 2: Python 2.7.15 (default, Jun 27 2018, 13:05:28) [GCC 8.1.1 20180531] on linux2 Type "help",
by auscompgeek 7y ago
New-style classes never became the default in Python 2:
Python 2.7.15 (default, Jun 27 2018, 13:05:28)
[GCC 8.1.1 20180531] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
... pass
...
>>> Foo
<class __main__.Foo at 0x6218e384ee88>
>>> class Bar(object):
... pass
...
>>> Bar
<class '__main__.Bar'>
>>> isinstance(Bar, type)
True
>>> isinstance(Foo, type)
False
- nerdwaller 7y agoThank you for the correction! I’ve not used Py2 in 6 or so years.