Skip to content

Commit 2678cc7

Browse files
committed
Documentation be gone!
1 parent 2ac3116 commit 2678cc7

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Doc/library/typing.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,22 +1302,6 @@ These are not used in annotations. They are building blocks for creating generic
13021302

13031303
c = concatenate('one', b'two') # error: type variable 'A' can be either str or bytes in a function call, but not both
13041304

1305-
If a generic type is commonly generic over just one type you can use
1306-
``default`` to specify this type::
1307-
1308-
T = TypeVar("T", default=int)
1309-
1310-
class Box(Generic[T]):
1311-
def __init__(self, value: T | None = None):
1312-
self.value = value
1313-
1314-
reveal_type(Box()) # type is Box[int]
1315-
reveal_type(Box(value="Hello World!")) # type is Box[str]
1316-
1317-
A TypeVar without a default cannot follow a TypeVar with a default.
1318-
1319-
.. TODO add more about this
1320-
13211305
At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general,
13221306
:func:`isinstance` and :func:`issubclass` should not be used with types.
13231307

0 commit comments

Comments
 (0)