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
d51ce7de
Kaydet (Commit)
d51ce7de
authored
Tem 15, 2003
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Indexing is a mess; try to get the link targets closer to the relevant
text. There needs to be a better way.
üst
4e72e053
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
ref3.tex
Doc/ref/ref3.tex
+2
-3
ref6.tex
Doc/ref/ref6.tex
+9
-11
No files found.
Doc/ref/ref3.tex
Dosyayı görüntüle @
d51ce7de
...
@@ -610,7 +610,8 @@ is a shorthand for \code{x.__call__(arguments)}.
...
@@ -610,7 +610,8 @@ is a shorthand for \code{x.__call__(arguments)}.
\item
[Modules]
\item
[Modules]
Modules are imported by the
\keyword
{
import
}
statement (see
Modules are imported by the
\keyword
{
import
}
statement (see
section~
\ref
{
import
}
, ``The
\keyword
{
import
}
statement'').
section~
\ref
{
import
}
, ``The
\keyword
{
import
}
statement'').
%
\stindex
{
import
}
\obindex
{
module
}
A module object has a namespace implemented by a dictionary object
A module object has a namespace implemented by a dictionary object
(this is the dictionary referenced by the func
_
globals attribute of
(this is the dictionary referenced by the func
_
globals attribute of
functions defined in the module). Attribute references are translated
functions defined in the module). Attribute references are translated
...
@@ -619,8 +620,6 @@ to lookups in this dictionary, e.g., \code{m.x} is equivalent to
...
@@ -619,8 +620,6 @@ to lookups in this dictionary, e.g., \code{m.x} is equivalent to
A module object does not contain the code object used to
A module object does not contain the code object used to
initialize the module (since it isn't needed once the initialization
initialize the module (since it isn't needed once the initialization
is done).
is done).
\stindex
{
import
}
\obindex
{
module
}
Attribute assignment updates the module's namespace dictionary,
Attribute assignment updates the module's namespace dictionary,
e.g.,
\samp
{
m.x = 1
}
is equivalent to
\samp
{
m.
__
dict
__
["x"] = 1
}
.
e.g.,
\samp
{
m.x = 1
}
is equivalent to
\samp
{
m.
__
dict
__
["x"] = 1
}
.
...
...
Doc/ref/ref6.tex
Dosyayı görüntüle @
d51ce7de
...
@@ -660,18 +660,16 @@ given as \code{sys.path}.
...
@@ -660,18 +660,16 @@ given as \code{sys.path}.
\indexii
{
filename
}{
extension
}
\indexii
{
filename
}{
extension
}
\indexiii
{
module
}{
search
}{
path
}
\indexiii
{
module
}{
search
}{
path
}
If a built-in module is found, its built-in initialization code is
If a built-in module is found,
\indexii
{
module
}{
initialization
}
its
executed and step (1) is finished. If no matching file is found,
built-in initialization code is executed and step (1) is finished. If
\exception
{
ImportError
}
is raised. If a file is found, it is parsed,
no matching file is found,
\exception
{
ImportError
}
\exindex
{
ImportError
}
is raised.
\index
{
code block
}
If a file is found, it is parsed,
yielding an executable code block. If a syntax error occurs,
yielding an executable code block. If a syntax error occurs,
\exception
{
SyntaxError
}
is raised. Otherwise, an empty module of the given
\exception
{
SyntaxError
}
\exindex
{
SyntaxError
}
is raised. Otherwise, an
name is created and inserted in the module table, and then the code
empty module of the given name is created and inserted in the module
block is executed in the context of this module. Exceptions during
table, and then the code block is executed in the context of this
this execution terminate step (1).
module. Exceptions during this execution terminate step (1).
\indexii
{
module
}{
initialization
}
\exindex
{
SyntaxError
}
\exindex
{
ImportError
}
\index
{
code block
}
When step (1) finishes without raising an exception, step (2) can
When step (1) finishes without raising an exception, step (2) can
begin.
begin.
...
...
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