diff --git a/stdlib/VERSIONS b/stdlib/VERSIONS index bd1abd204..d24aa35fa 100644 --- a/stdlib/VERSIONS +++ b/stdlib/VERSIONS @@ -152,6 +152,7 @@ importlib: 2.7- importlib.metadata: 3.8- importlib.metadata._meta: 3.10- importlib.resources: 3.7- +importlib.resources.abc: 3.11- inspect: 2.7- io: 2.7- ipaddress: 3.3- diff --git a/stdlib/importlib/resources.pyi b/stdlib/importlib/resources/__init__.pyi similarity index 100% rename from stdlib/importlib/resources.pyi rename to stdlib/importlib/resources/__init__.pyi diff --git a/stdlib/importlib/resources/abc.pyi b/stdlib/importlib/resources/abc.pyi new file mode 100644 index 000000000..a36c952d0 --- /dev/null +++ b/stdlib/importlib/resources/abc.pyi @@ -0,0 +1,12 @@ +import sys + +if sys.version_info >= (3, 11): + # These are all actually defined in this file on 3.11+, + # and re-exported from importlib.abc, + # but it's much less code duplication for typeshed if we pretend that they're still defined + # in importlib.abc on 3.11+, and re-exported from this file + from importlib.abc import ( + ResourceReader as ResourceReader, + Traversable as Traversable, + TraversableResources as TraversableResources, + )