Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
78246b6b
Kaydet (Commit)
78246b6b
authored
Ock 25, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Document both importlib.machinery.BuiltinImporter and FrozenImporter.
üst
51d4aabf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
9 deletions
+49
-9
importlib.rst
Doc/library/importlib.rst
+47
-1
NOTES
Lib/importlib/NOTES
+0
-6
_bootstrap.py
Lib/importlib/_bootstrap.py
+2
-2
No files found.
Doc/library/importlib.rst
Dosyayı görüntüle @
78246b6b
...
@@ -61,7 +61,7 @@ providing custom importers can be found in :pep:`302`.
...
@@ -61,7 +61,7 @@ providing custom importers can be found in :pep:`302`.
Functions
Functions
---------
---------
..
function
::
__import__
(
name
,
globals
={},
locals
={},
fromlist
=
\[\]
,
level
=
0
)
..
function
::
__import__
(
name
,
globals
={},
locals
={},
fromlist
=
list
()
,
level
=
0
)
An
implementation
of
the
built
-
in
:
func
:`
__import__
`
function
.
See
the
An
implementation
of
the
built
-
in
:
func
:`
__import__
`
function
.
See
the
built
-
in
function
's documentation for usage instructions.
built
-
in
function
's documentation for usage instructions.
...
@@ -76,3 +76,49 @@ Functions
...
@@ -76,3 +76,49 @@ Functions
package name (e.g. ``import_module('
..
mod
', '
pkg
.
subpkg
')`` will import
package name (e.g. ``import_module('
..
mod
', '
pkg
.
subpkg
')`` will import
``pkg.mod``). The specified module will be inserted into
``pkg.mod``). The specified module will be inserted into
:data:`sys.modules` and returned.
:data:`sys.modules` and returned.
:mod:`importlib.machinery` -- Importers and path hooks
------------------------------------------------------
.. module:: importlib.machinery
:synopsis: Importers and path hooks
This module contains the various objects that help :keyword:`import`
find and load modules.
.. class:: BuiltinImporter
:term:`Importer` for built-in modules. All known built-in modules are
listed in :data:`sys.builtin_module_names`.
Only class methods are defined by this class to alleviate the need for
instantiation.
.. method:: find_module(fullname, path=None)
Class method that allows this class to be a :term:`finder` for built-in
modules.
.. method:: load_module(fullname)
Class method that allows this class to be a :term:`loader` for built-in
modules.
.. class:: FrozenImporter
:term:`Importer` for frozen modules.
Only class methods are defined by this class to alleviate the need for
instantiation.
.. method:: find_module(fullname, path=None)
Class method that allows this class to be a :term:`finder` for frozen
modules.
.. method:: load_module(fullname)
Class method that allows this class to be a :term:`loader` for frozen
modules.
Lib/importlib/NOTES
Dosyayı görüntüle @
78246b6b
to do
to do
/////
/////
* Document:
+ The terms "importer", "finder", and "loader".
+ machinery.BuiltinImporter.
+ machinery.FrozenImporter.
* Expose resolve_name().
* Expose resolve_name().
* Backport to Python 2.7.
* Backport to Python 2.7.
...
...
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
78246b6b
...
@@ -110,8 +110,8 @@ class BuiltinImporter:
...
@@ -110,8 +110,8 @@ class BuiltinImporter:
return
None
return
None
return
cls
if
imp
.
is_builtin
(
fullname
)
else
None
return
cls
if
imp
.
is_builtin
(
fullname
)
else
None
@
static
method
@
class
method
def
load_module
(
fullname
):
def
load_module
(
cls
,
fullname
):
"""Load a built-in module."""
"""Load a built-in module."""
if
fullname
not
in
sys
.
builtin_module_names
:
if
fullname
not
in
sys
.
builtin_module_names
:
raise
ImportError
(
"{0} is not a built-in module"
.
format
(
fullname
))
raise
ImportError
(
"{0} is not a built-in module"
.
format
(
fullname
))
...
...
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