New submission from VA <>:

object.__new__ takes only the class argument, but it still accepts extra 
arguments if a class doesn't override __new__, and rejects them otherwise. 
(This is because __new__ will receive the same arguments as __init__ but 
__new__ shouldn't need to be overridden just to remove args)

However, if a class has a custom __new__ at one point (in a parent class), and 
at a later point __bases__ is changed, object.__new__ will still reject 
arguments, although __new__ may not be overridden anymore at that point. See 
attached file.

I can't check with all Python 3 versions, but the same code works fine in 
Python 2.

messages: 311622
nosy: VA
priority: normal
severity: normal
status: open
title: object.__new__ does not accept arguments if __bases__ is changed
type: behavior
versions: Python 3.6
Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to