mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
* contextlib.pyi ExitStack.callback take Callable
The documentation for ExitStack does not specify the return type of the callable's passed to callback.
Saying that they always return None breaks a very common use case for ExitStack, which is to "schedule" changes to a collection
while iterating it.
```
with ExitStack() as stack:
for key, value in adict.items():
if ...:
stack.callback(adict.pop, key)
```
I also added AsyncExitStack, using Awaitable.
* Moving to Explicit Any in Generics