Skip to content

Commit ee1f4c9

Browse files
authoredJan 13, 2025··
Update docs not to mention 3.8 where possible (#18455)
I updated docs to not mention EOL 3.8, where it is possible to use other versions / examples.
1 parent a49d991 commit ee1f4c9

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed
 

‎docs/source/common_issues.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ More specifically, mypy will understand the use of :py:data:`sys.version_info` a
427427
import sys
428428
429429
# Distinguishing between different versions of Python:
430-
if sys.version_info >= (3, 8):
431-
# Python 3.8+ specific definitions and imports
430+
if sys.version_info >= (3, 13):
431+
# Python 3.13+ specific definitions and imports
432432
else:
433433
# Other definitions and imports
434434

‎docs/source/runtime_troubles.rst

+6-10
Original file line numberDiff line numberDiff line change
@@ -335,29 +335,25 @@ Using new additions to the typing module
335335
----------------------------------------
336336

337337
You may find yourself wanting to use features added to the :py:mod:`typing`
338-
module in earlier versions of Python than the addition, for example, using any
339-
of ``Literal``, ``Protocol``, ``TypedDict`` with Python 3.6.
338+
module in earlier versions of Python than the addition.
340339

341340
The easiest way to do this is to install and use the ``typing_extensions``
342341
package from PyPI for the relevant imports, for example:
343342

344343
.. code-block:: python
345344
346-
from typing_extensions import Literal
347-
x: Literal["open", "close"]
345+
from typing_extensions import TypeIs
348346
349347
If you don't want to rely on ``typing_extensions`` being installed on newer
350348
Pythons, you could alternatively use:
351349

352350
.. code-block:: python
353351
354352
import sys
355-
if sys.version_info >= (3, 8):
356-
from typing import Literal
353+
if sys.version_info >= (3, 13):
354+
from typing import TypeIs
357355
else:
358-
from typing_extensions import Literal
359-
360-
x: Literal["open", "close"]
356+
from typing_extensions import TypeIs
361357
362358
This plays nicely well with following :pep:`508` dependency specification:
363-
``typing_extensions; python_version<"3.8"``
359+
``typing_extensions; python_version<"3.13"``

0 commit comments

Comments
 (0)
Please sign in to comment.