[New-bugs-announce] [issue40304] Classes created using type() don't need to explicitly inherit from object

Борис Верховский report at bugs.python.org
Thu Apr 16 13:31:50 EDT 2020


New submission from Борис Верховский <boris.verk at gmail.com>:

As far as I can tell, passing `(object,)` and `()` as the `bases` parameter to the 3-argument version of type() produces the same result, because classes inherit from `object` in Python 3:

>>> type('X', (object,), dict(a=1)).__bases__
(<class 'object'>,)
>>> type('X', (), dict(a=1)).__bases__
(<class 'object'>,)

I just want to make sure I'm not missing something and update the documentation of `type()` to reflect that.

----------
assignee: docs at python
components: Documentation
messages: 366613
nosy: boris, docs at python
priority: normal
pull_requests: 18902
severity: normal
status: open
title: Classes created using type() don't need to explicitly inherit from object
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40304>
_______________________________________


More information about the New-bugs-announce mailing list