Oleg Oshmyan <chor...@inbox.lv> added the comment:

$ python3.2
Python 3.2 (r32:88445, Mar 28 2011, 16:46:36) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.core import Extension
>>> Extension('myext', define_macros=[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() takes at least 3 arguments (3 given)
>>> 
$ python3.1
Python 3.1.3 (r313:86834, Mar 28 2011, 16:44:43) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.core import Extension
>>> Extension('myext', define_macros=[])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() takes at least 3 non-keyword positional arguments (2 
given)
>>> 

Looking at the patch committed in r79235, it changes the message to display the 
total number of arguments passed in and not just required ones. This specific 
change should be reversed since it produces messages like the one quoted above. 
(In case you were wondering, passing another optional keyword argument does 
indeed result in a complaint that at least 3 arguments are taken but 4 are 
passed.) For even better results, I would suggest rewording the message to make 
it clear that the requirement refers only to arguments without default values.

----------
nosy: +chortos

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

Reply via email to