New submission from Alexander Belopolsky <alexander.belopol...@gmail.com>:

>>> object(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object.__new__() takes no parameters


This is misleading because object.__new__() takes one parameter:

>>> object.__new__(object)
<object object at 0x100413980>


I suggest changing "object.__new__() takes no parameters" to "object() takes no 
parameters".

Some other inconsistencies that I noticed:

>>> tuple.__new__(tuple, 1, 2, 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: tuple() takes at most 1 argument (3 given)

but

>>> list.__new__(list, 1, 2, 3)
[]

----------
components: Interpreter Core
messages: 99547
nosy: Alexander.Belopolsky
severity: normal
status: open
title: Misleading error message from object(arg)
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7963>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to