Message260441
| Author |
SilentGhost |
| Recipients |
Alexander.Belopolsky, Anders.Hovmöller, Arfrever, SilentGhost, aymeric.augustin, barry, belopolsky, berker.peksag, cvrebert, davydov, deronnax, eric.araujo, flying sheep, jcea, jstasiak, jwilk, karlcow, kirpit, martin.panter, mcepl, mihaic, nagle, pbryan, perey, piotr.dobrogost, r.david.murray, roysmith, vstinner |
| Date |
2016年02月18日.08:37:41 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1455784661.62.0.73120173645.issue15873@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Mathieu, nothing was attached. The penalty's worth only a few if statements, I wouldn't worry too much about it. Besides, a C version is going to be provided as well, right?
Perhaps the following approach might solve the subclasses problem:
regex = dispatch.get(cls)
if not regex:
classes = datetime, date, time
cls = next((c for c in classes if issubclass(cls, c)), None)
if cls is None:
raise TypeError
regex = dispatch[cls]
Perhaps, TypeError is unnecessary there and just propagating StopIteration would do. In that case the if clause would look like:
classes = datetime, date, time
cls = next(c for c in classes if issubclass(cls, c))
regex = dispatch[cls] |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年02月18日 08:37:41 | SilentGhost | set | recipients:
+ SilentGhost, barry, jcea, roysmith, belopolsky, nagle, vstinner, jwilk, mcepl, eric.araujo, Arfrever, r.david.murray, davydov, cvrebert, karlcow, Alexander.Belopolsky, perey, flying sheep, mihaic, aymeric.augustin, berker.peksag, martin.panter, piotr.dobrogost, kirpit, Anders.Hovmöller, jstasiak, deronnax, pbryan |
| 2016年02月18日 08:37:41 | SilentGhost | set | messageid: <1455784661.62.0.73120173645.issue15873@psf.upfronthosting.co.za> |
| 2016年02月18日 08:37:41 | SilentGhost | link | issue15873 messages |
| 2016年02月18日 08:37:41 | SilentGhost | create |
|