mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix a typo in the section about type hinting context managers (#4185)
This commit is contained in:
@@ -278,7 +278,7 @@ they are not part of the stubbed API.
|
||||
|
||||
When adding type annotations for context manager classes, annotate
|
||||
the return type of `__exit__` as bool only if the context manager
|
||||
sometimes suppresses annotations -- if it sometimes returns `True`
|
||||
sometimes suppresses exceptions -- if it sometimes returns `True`
|
||||
at runtime. If the context manager never suppresses exceptions,
|
||||
have the return type be either `None` or `Optional[bool]`. If you
|
||||
are not sure whether exceptions are suppressed or not or if the
|
||||
|
||||
Reference in New Issue
Block a user