File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import sys
3
4
from typing import TYPE_CHECKING
4
5
from typing import Any
5
6
from typing import Iterable
21
22
from narwhals .utils import _SeriesNamespace
22
23
from narwhals .utils import unstable
23
24
25
+ if not TYPE_CHECKING : # pragma: no cover
26
+ if sys .version_info >= (3 , 9 ):
27
+ from typing import Protocol as Protocol38
28
+ else :
29
+ from typing import Generic as Protocol38
30
+ else : # pragma: no cover
31
+ # TODO @dangotbanned: Remove after dropping `3.8` (#2084)
32
+ # - https://github.com/narwhals-dev/narwhals/pull/2064#discussion_r1965921386
33
+ from typing import Protocol as Protocol38
34
+
24
35
if TYPE_CHECKING :
25
36
from types import ModuleType
26
37
@@ -306,7 +317,7 @@ def struct(self) -> Any: ...
306
317
307
318
class EagerSeriesNamespace ( # type: ignore[misc]
308
319
_SeriesNamespace [EagerSeriesT_co , NativeSeriesT_co ],
309
- Protocol [EagerSeriesT_co , NativeSeriesT_co ],
320
+ Protocol38 [EagerSeriesT_co , NativeSeriesT_co ],
310
321
):
311
322
_compliant_series : EagerSeriesT_co
312
323
You can’t perform that action at this time.
0 commit comments