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
2b9fd47d
Kaydet (Commit)
2b9fd47d
authored
Mar 15, 2009
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix docs for __import__ that say the default for 'level' is -1; it's actually
0.
üst
a113ac58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
functions.rst
Doc/library/functions.rst
+5
-6
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
2b9fd47d
...
@@ -1207,9 +1207,8 @@ are always available. They are listed here in alphabetical order.
...
@@ -1207,9 +1207,8 @@ are always available. They are listed here in alphabetical order.
not use its *locals* argument at all, and uses its *globals* only to
not use its *locals* argument at all, and uses its *globals* only to
determine the package context of the :keyword:`import` statement.
determine the package context of the :keyword:`import` statement.
*level* specifies whether to use absolute or relative imports. The default
*level* specifies whether to use absolute or relative imports. ``0`` (the
is ``-1`` which indicates both absolute and relative imports will be
default) means only perform absolute imports. Positive values for
attempted. ``0`` means only perform absolute imports. Positive values for
*level* indicate the number of parent directories to search relative to the
*level* indicate the number of parent directories to search relative to the
directory of the module calling :func:`__import__`.
directory of the module calling :func:`__import__`.
...
@@ -1221,11 +1220,11 @@ are always available. They are listed here in alphabetical order.
...
@@ -1221,11 +1220,11 @@ are always available. They are listed here in alphabetical order.
For example, the statement ``import spam`` results in bytecode resembling the
For example, the statement ``import spam`` results in bytecode resembling the
following code::
following code::
spam = __import__('spam', globals(), locals(), [],
-1
)
spam = __import__('spam', globals(), locals(), [],
0
)
The statement ``import spam.ham`` results in this call::
The statement ``import spam.ham`` results in this call::
spam = __import__('spam.ham', globals(), locals(), [],
-1
)
spam = __import__('spam.ham', globals(), locals(), [],
0
)
Note how :func:`__import__` returns the toplevel module here because this is
Note how :func:`__import__` returns the toplevel module here because this is
the object that is bound to a name by the :keyword:`import` statement.
the object that is bound to a name by the :keyword:`import` statement.
...
@@ -1233,7 +1232,7 @@ are always available. They are listed here in alphabetical order.
...
@@ -1233,7 +1232,7 @@ are always available. They are listed here in alphabetical order.
On the other hand, the statement ``from spam.ham import eggs, sausage as
On the other hand, the statement ``from spam.ham import eggs, sausage as
saus`` results in ::
saus`` results in ::
_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'],
-1
)
_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'],
0
)
eggs = _temp.eggs
eggs = _temp.eggs
saus = _temp.sausage
saus = _temp.sausage
...
...
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