Skip to content

Replaced typing.Self with typing_extensions.Self #12744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/12744.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed typing compatibility with Python 3.9 or less -- replaced `typing.Self` with `typing_extensions.Self` -- by :user:`Avasam`
3 changes: 2 additions & 1 deletion src/_pytest/doctest.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@

if TYPE_CHECKING:
import doctest
from typing import Self

from typing_extensions import Self

DOCTEST_REPORT_CHOICE_NONE = "none"
DOCTEST_REPORT_CHOICE_CDIFF = "cdiff"
2 changes: 1 addition & 1 deletion src/_pytest/nodes.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@


if TYPE_CHECKING:
from typing import Self
from typing_extensions import Self

# Imported here due to circular import.
from _pytest.main import Session
2 changes: 1 addition & 1 deletion src/_pytest/python.py
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@


if TYPE_CHECKING:
from typing import Self
from typing_extensions import Self


def pytest_addoption(parser: Parser) -> None:
Loading