This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect TypeError message for wrong function arguments
Type: behavior Stage: resolved
Components: Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, eric.araujo, jcea, r.david.murray, tsou
Priority: normal Keywords:

Created on 2012-05-25 16:21 by tsou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg161588 - (view) Author: Thanos Tsouanas (tsou) Date: 2012-05-25 16:21
# This correctly raises a type error, but the explanation
# that comes with it is bad:

def foo(x, y, z=28):
    return

foo(x, z=8)

# TypeError: foo() takes at least 2 arguments (2 given)
msg162085 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-06-01 17:59
I think this was fixed in 3.3, and maybe backported.  Could you test with the latest releases?
msg162092 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-01 18:08
It is fixed.  It was not backported.
History
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 59123
2012-08-01 01:36:25jceasetnosy: + jcea
2012-06-01 18:08:58r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg162092

resolution: duplicate
stage: resolved
2012-06-01 17:59:35eric.araujosetnosy: + eric.araujo, benjamin.peterson
title: Incorrect explanation of TypeError exception -> Incorrect TypeError message for wrong function arguments
messages: + msg162085

versions: + Python 3.3
2012-05-25 16:21:04tsoucreate