Skip to content

Commit 9cc4585

Browse files
committed
Move to _common
1 parent 3ec6587 commit 9cc4585

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

stdlib/importlib/resources/__init__.pyi

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import sys
33
from _typeshed import StrPath
44
from collections.abc import Iterator
55
from contextlib import AbstractContextManager
6+
from importlib.resources._common import Package
67
from io import TextIOWrapper
78
from pathlib import Path
8-
from types import ModuleType
99
from typing import Any, BinaryIO, TextIO, overload
1010
from typing_extensions import TypeAlias, Unpack
1111

@@ -21,15 +21,12 @@ if sys.version_info >= (3, 10):
2121
__all__ += ["ResourceReader"]
2222

2323
if sys.version_info >= (3, 13):
24+
from importlib.resources._common import Anchor
25+
2426
__all__ += ["Anchor"]
2527
else:
2628
__all__ += ["Resource"]
2729

28-
Package: TypeAlias = str | ModuleType
29-
30-
if sys.version_info >= (3, 13):
31-
Anchor: TypeAlias = Package
32-
3330
if sys.version_info < (3, 11):
3431
Resource: TypeAlias = str | os.PathLike[Any]
3532
elif sys.version_info < (3, 13):
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys
2+
from types import ModuleType
3+
from typing import TypeAlias
4+
5+
Package: TypeAlias = str | ModuleType
6+
7+
if sys.version_info >= (3, 13):
8+
Anchor: TypeAlias = Package

0 commit comments

Comments
 (0)