Message381155
My implementation in PR 22848 turns callable into a type and uses `__new__`. It isn't too bad. It does appear to affect performance of callable though.
Here's some data on how often typing imports are used. This is the number of files in which `from typing import X` is present in mypy_primer's corpus (searched using the AST). My read of this is that Callable is meaningfully more used than anything else in collections.abc.
```
'Optional': 2563
'Any': 2402
'List': 2383
'Dict': 2150
'Tuple': 1592
'Union': 1269
'Callable': 1058
'Iterable': 609
'Set': 580
'cast': 505
'Sequence': 465
'Type': 438
'Iterator': 385
'TYPE_CHECKING': 357
'TypeVar': 302
'Mapping': 301
'Generator': 194
'NamedTuple': 138
'Text': 127
'IO': 120
'Awaitable': 116
...
``` |
|
Date |
User |
Action |
Args |
2020-11-16 20:45:35 | hauntsaninja | set | recipients:
+ hauntsaninja, gvanrossum, serhiy.storchaka, levkivskyi, BTaskaya, kj |
2020-11-16 20:45:35 | hauntsaninja | set | messageid: <1605559535.06.0.271212837058.issue42102@roundup.psfhosted.org> |
2020-11-16 20:45:35 | hauntsaninja | link | issue42102 messages |
2020-11-16 20:45:34 | hauntsaninja | create | |
|