03.09.21 10:34, Thomas Grainger пише: > I think that it would be good to make TypeError more fine-grained. > Another example is: > >>>> sum(1, 2, 3) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: sum() takes at most 2 arguments (3 given)
I agree that TypeErrors raised for incorrect number or names of arguments is a separate class of TypeErrors. But it is not related to my proposition. It includes also two kinds of errors: 1. Programming error. The author of the calling code uses a known function improperly or the author of the function break compatibility. 2. User input error. If a user provides an incompatible callable. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ZX2YFXHRI6BNWABCFRJ4GWRNW2RMAA7J/ Code of Conduct: http://python.org/psf/codeofconduct/