mirror of
https://github.com/jazzband/contextlib2.git
synced 2026-03-16 21:50:24 +00:00
backport _typeshed.Self
This commit is contained in:
parent
16db3dcf86
commit
a35252eefd
3 changed files with 12 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
|||
# https://github.com/python/typeshed/blob/64c85cdd449ccaff90b546676220c9ecfa6e697f/LICENSE
|
||||
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from ._typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
IO,
|
||||
|
|
|
|||
5
contextlib2/_typeshed.py
Normal file
5
contextlib2/_typeshed.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from typing import TypeVar
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
Self = TypeVar("Self")
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
--- ../contextlib.pyi 2021-07-16 08:26:16.409945194 +0100
|
||||
+++ contextlib2/__init__.pyi 2021-07-16 08:32:00.363150171 +0100
|
||||
@@ -1,3 +1,6 @@
|
||||
+++ contextlib2/__init__.pyi 2021-07-20 14:10:49.571136279 +0100
|
||||
@@ -1,5 +1,8 @@
|
||||
+# Type hints copied from the typeshed project under the Apache License 2.0
|
||||
+# https://github.com/python/typeshed/blob/64c85cdd449ccaff90b546676220c9ecfa6e697f/LICENSE
|
||||
+
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
-from _typeshed import Self
|
||||
+from ._typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
IO,
|
||||
@@ -17,8 +20,14 @@
|
||||
)
|
||||
from typing_extensions import ParamSpec, Protocol
|
||||
|
|
|
|||
Loading…
Reference in a new issue