Message118829
To me, Alexander's example
>>> calendar.isleap("%d")
False
is a buggy result. So I would reclassify the issue.
The rationale for not checking input types is that bad types result in an error, but that does not happen here due to a design decision that some consider clever and some buggy, and some both. (Guido himself would like to deprecate it.)
I am in favor of the 'year & 3 == 0' fix so that any input string (and indeed, anything that does not implement both % and & operators) raises an error. Intermediate to expert programmers should know or learn about bit masking. Add a comment to explain the reason -- and a test case. |
|
Date |
User |
Action |
Args |
2010-10-15 20:45:34 | terry.reedy | set | recipients:
+ terry.reedy, georg.brandl, belopolsky, pjenvey, eric.araujo, r.david.murray, shadikka |
2010-10-15 20:45:34 | terry.reedy | set | messageid: <1287175534.05.0.683235795744.issue10073@psf.upfronthosting.co.za> |
2010-10-15 20:45:32 | terry.reedy | link | issue10073 messages |
2010-10-15 20:45:31 | terry.reedy | create | |
|