Message26220
| Author |
loewis |
| Recipients |
| Date |
2005年12月27日.13:48:01 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=21627
I agree that the error message should be fixed; this is even
an 'XXX' comment ("an this isn't a bug?").
Unfortunately, just looking for bad keyword arguments is not
enough - it might even be that an optional keyword argument
is supplied, and still the error message is confusing, e.g. for
>>> re.compile("a").match(pos=10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: match() takes at least 1 argument (0 given)
Instead, I think the error message should read:
TypeError: "pattern" argument for match() is missing
as we know exactly what "meaning" the missing argument has.
This might still be unspecific if multiple required
arguments are missing, but I think just giving the first one
would be informative enough - or else it could read
TypeError: "pattern" argument for match() is missing (+2 more)
if there are 2 more missing.
Yet alternatively, it could read
TypeError: required arguments for match() missing:
'pattern', 'foo', 'bar'
Patches in this direction are welcome; the precise wording
proposal should be mentioned on python-dev. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:34:19 | admin | link | issue1283289 messages |
| 2007年08月23日 14:34:19 | admin | create |
|