Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
997b8c14
Commit
997b8c14
authored
Feb 16, 2018
by
Barry Warsaw
Committed by
GitHub
Feb 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update and sync importlib.resources documentation (#5694)
parent
7745ec4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
Doc/library/importlib.rst
Doc/library/importlib.rst
+22
-5
No files found.
Doc/library/importlib.rst
View file @
997b8c14
...
...
@@ -369,9 +369,9 @@ ABC hierarchy::
An
abstract
base
class
for
a
:
term
:`
loader
`.
See
:
pep
:`
302
`
for
the
exact
definition
for
a
loader
.
For
loaders
that
wish
to
support
resource
reading
,
they
should
implement
a
``
get_resource_reader
(
fullname
)``
method
as
specified
by
:
class
:`
importlib
.
abc
.
ResourceReader
`.
Loaders
that
wish
to
support
resource
reading
should
implement
a
``
get_resource_reader
(
fullname
)``
method
as
specified
by
:
class
:`
importlib
.
abc
.
ResourceReader
`.
..
versionchanged
::
3.7
Introduced
the
optional
``
get_resource_reader
()``
method
.
...
...
@@ -813,8 +813,25 @@ Resources are roughly akin to files inside directories, though it's important
to
keep
in
mind
that
this
is
just
a
metaphor
.
Resources
and
packages
**
do
not
**
have
to
exist
as
physical
files
and
directories
on
the
file
system
.
Loaders
can
support
resources
by
implementing
the
:
class
:`
ResourceReader
`
abstract
base
class
.
..
note
::
This
module
provides
functionality
similar
to
`
pkg_resources
<
https
://
setuptools
.
readthedocs
.
io
/
en
/
latest
/
pkg_resources
.
html
>`
_
`
Basic
Resource
Access
<
http
://
setuptools
.
readthedocs
.
io
/
en
/
latest
/
pkg_resources
.
html
#
basic
-
resource
-
access
>`
_
without
the
performance
overhead
of
that
package
.
This
makes
reading
resources
included
in
packages
easier
,
with
more
stable
and
consistent
semantics
.
The
standalone
backport
of
this
module
provides
more
information
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
>`
_
.
Loaders
that
wish
to
support
resource
reading
should
implement
a
``
get_resource_reader
(
fullname
)``
method
as
specified
by
:
class
:`
importlib
.
abc
.
ResourceReader
`.
The
following
types
are
defined
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment