Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 54679e7

Browse filesBrowse files
committed
Revert "fix(typings) Move typing-extensions into TypeGuard"
This reverts commit cc4e888.
1 parent 09d4330 commit 54679e7
Copy full SHA for 54679e7

File tree

Expand file treeCollapse file tree

4 files changed

+10
-20
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-20
lines changed

‎src/libtmux/pane.py

Copy file name to clipboardExpand all lines: src/libtmux/pane.py
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import typing as t
1414
import warnings
1515

16+
from typing_extensions import Self
17+
1618
from libtmux.common import has_gte_version, has_lt_version, tmux_cmd
1719
from libtmux.constants import (
1820
PANE_DIRECTION_FLAG_MAP,
@@ -26,17 +28,12 @@
2628
from . import exc
2729

2830
if t.TYPE_CHECKING:
29-
import sys
3031
import types
3132

3233
from .server import Server
3334
from .session import Session
3435
from .window import Window
3536

36-
if sys.version_info >= (3, 11):
37-
from typing import Self
38-
else:
39-
from typing_extensions import Self
4037

4138
logger = logging.getLogger(__name__)
4239

‎src/libtmux/server.py

Copy file name to clipboardExpand all lines: src/libtmux/server.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import typing as t
1616
import warnings
1717

18+
from typing_extensions import Self
19+
1820
from libtmux._internal.query_list import QueryList
1921
from libtmux.common import tmux_cmd
2022
from libtmux.neo import fetch_objs
@@ -37,9 +39,9 @@
3739
import types
3840

3941
if sys.version_info >= (3, 10):
40-
from typing import Self, TypeAlias
42+
from typing import TypeAlias
4143
else:
42-
from typing_extensions import Self, TypeAlias
44+
from typing_extensions import TypeAlias
4345

4446
DashLiteral: TypeAlias = t.Literal["-"]
4547

‎src/libtmux/session.py

Copy file name to clipboardExpand all lines: src/libtmux/session.py
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import typing as t
1414
import warnings
1515

16+
from typing_extensions import Self
17+
1618
from libtmux._internal.query_list import QueryList
1719
from libtmux.constants import WINDOW_DIRECTION_FLAG_MAP, WindowDirection
1820
from libtmux.formats import FORMAT_SEPARATOR
@@ -31,16 +33,10 @@
3133
)
3234

3335
if t.TYPE_CHECKING:
34-
import sys
3536
import types
3637

3738
from libtmux.common import tmux_cmd
3839

39-
if sys.version_info >= (3, 11):
40-
from typing import Self
41-
else:
42-
from typing_extensions import Self
43-
4440
from .server import Server
4541

4642

‎src/libtmux/window.py

Copy file name to clipboardExpand all lines: src/libtmux/window.py
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import typing as t
1414
import warnings
1515

16+
from typing_extensions import Self
17+
1618
from libtmux._internal.query_list import QueryList
1719
from libtmux.common import has_gte_version, tmux_cmd
1820
from libtmux.constants import (
@@ -28,18 +30,11 @@
2830
from .common import PaneDict, WindowOptionDict, handle_option_error
2931

3032
if t.TYPE_CHECKING:
31-
import sys
3233
import types
3334

3435
from .server import Server
3536
from .session import Session
3637

37-
if sys.version_info >= (3, 11):
38-
from typing import Self
39-
else:
40-
from typing_extensions import Self
41-
42-
4338
logger = logging.getLogger(__name__)
4439

4540

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.