mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fix decimal and contextlib (#428)
* Decimal does not support __round__, and its __abs__ returns Decimal. * Fix contextmanager signature too.
This commit is contained in:
committed by
Matthias Kramm
parent
fd66ff21ae
commit
6e596e9609
@@ -1,7 +1,7 @@
|
||||
# Stubs for contextlib
|
||||
|
||||
from typing import (
|
||||
Any, Callable, Generator, IO, Optional, Type,
|
||||
Any, Callable, Generator, IO, Iterator, Optional, Type,
|
||||
Generic, TypeVar,
|
||||
)
|
||||
from types import TracebackType
|
||||
@@ -20,7 +20,7 @@ class ContextManager(Generic[_T]):
|
||||
exc_val: Optional[Exception],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
|
||||
def contextmanager(func: Callable[..., Generator[None, None, None]]) -> Callable[..., ContextManager[None]]: ...
|
||||
def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., ContextManager[_T]]: ...
|
||||
|
||||
if sys.version_info < (3,):
|
||||
def nested(*mgr: ContextManager[Any]) -> ContextManager[None]: ...
|
||||
|
||||
Reference in New Issue
Block a user