4 ms·
Extending `object` was necessary until 2.7 when it became the default and old style classes were removed entirely in 3. So I think while the GP comment recently
by nerdwaller 7y ago
Extending `object` was necessary until 2.7 when it became the default and old style classes were removed entirely in 3. So I think while the GP comment recently learned they don’t need to extend `object` anymore, they are/were familiar with new style vs old style classes.
- DonaldPShimoda 7y agoRight! Yes, another commenter pointed that out to me too. I made a goof and misremembered some things haha. Oops.
- auscompgeek 7y agoNew-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.