Message225842
| Author |
Gregory.Salvan |
| Recipients |
Gregory.Salvan |
| Date |
2014年08月24日.22:17:47 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1408918667.95.0.696624554898.issue22268@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It's a small refactoring.
Lurking at collections.abc I found a lot of:
>>> any(attr in B.__dict__ for B in C.__mro__)
also repeated in typing.py of mypy:
https://github.com/JukkaL/mypy/blob/master/lib-typing/3.2/typing.py#L117
It seems to be a common operation to check or get an attribute from mro in abc, so I thought it could help to have dedicated functions to enhance readability.
(see patch e.g. Hash.__subclasshook__ takes 1 line intead of 7...) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年08月24日 22:17:48 | Gregory.Salvan | set | recipients:
+ Gregory.Salvan |
| 2014年08月24日 22:17:47 | Gregory.Salvan | set | messageid: <1408918667.95.0.696624554898.issue22268@psf.upfronthosting.co.za> |
| 2014年08月24日 22:17:47 | Gregory.Salvan | link | issue22268 messages |
| 2014年08月24日 22:17:47 | Gregory.Salvan | create |
|