diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.rst | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 59c8c64..347e08e 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -917,7 +917,9 @@ not** have to exist as physical files and directories on the file system. on `using importlib.resources <http://importlib-resources.readthedocs.io/en/latest/using.html>`_ and `migrating from pkg_resources to importlib.resources - <http://importlib-resources.readthedocs.io/en/latest/migration.html>`_. + <http://importlib-resources.readthedocs.io/en/latest/migration.html>`_ + and + `migrating legacy usage <https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_. Loaders that wish to support resource reading should implement a ``get_resource_reader(fullname)`` method as specified by @@ -979,6 +981,8 @@ The following functions are available. sub-resources (i.e. it cannot be a directory). This function returns a ``typing.BinaryIO`` instance, a binary I/O stream open for reading. + .. deprecated:: 3.11 + .. function:: open_text(package, resource, encoding='utf-8', errors='strict') @@ -994,6 +998,8 @@ The following functions are available. This function returns a ``typing.TextIO`` instance, a text I/O stream open for reading. + .. deprecated:: 3.11 + .. function:: read_binary(package, resource) @@ -1006,6 +1012,8 @@ The following functions are available. sub-resources (i.e. it cannot be a directory). This function returns the contents of the resource as :class:`bytes`. + .. deprecated:: 3.11 + .. function:: read_text(package, resource, encoding='utf-8', errors='strict') @@ -1019,6 +1027,8 @@ The following functions are available. have the same meaning as with built-in :func:`open`. This function returns the contents of the resource as :class:`str`. + .. deprecated:: 3.11 + .. function:: path(package, resource) @@ -1034,6 +1044,8 @@ The following functions are available. within *package*; it may not contain path separators and it may not have sub-resources (i.e. it cannot be a directory). + .. deprecated:: 3.11 + .. function:: is_resource(package, name) @@ -1042,6 +1054,8 @@ The following functions are available. *package* is either a name or a module object which conforms to the ``Package`` requirements. + .. deprecated:: 3.11 + .. function:: contents(package) @@ -1052,6 +1066,8 @@ The following functions are available. *package* is either a name or a module object which conforms to the ``Package`` requirements. + .. deprecated:: 3.11 + :mod:`importlib.machinery` -- Importers and path hooks ------------------------------------------------------ |