Hacker News new | past | comments | ask | show | jobs | submit login

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



Thank you for the correction! I’ve not used Py2 in 6 or so years.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: