On 21/09/12 05:45, Ethan Furman wrote:

I don't expect error messages to give a complete catalog of every
problem with a specific function call. If f() reports that required
argument 'a' is missing, that does not imply that no other required
arguments are also missing. I think it is perfectly acceptable to
not report the missing 'b' until the missing 'a' is resolved.

I disagree. There is no reason (that I'm aware of ;) that the missing
'b' cannot be noticed and reported at the same time as the missing 'a'.

Listing every missing argument does not scale well as the number of
arguments increases.

def f(spam, ham, cheese, aardvark, halibut, *,  shrubbery, parrot, 
wafer_thin_mint):
    pass

f()

I would be -0 on an error message like:

TypeError: f() needs arguments 'spam', 'ham', 'cheese', 'aardvark', 'halibut' 
and keyword-only arguments 'shrubbery', 'parrot', 'wafer_thin_mint'

but wouldn't strongly object. I think it is acceptable (although not
ideal) if calling f() only reported the first missing argument it
noticed.

But I do think that we should not make any language guarantees about
error messages being "complete" or not.


--
Steven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to