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
4e86195a
Kaydet (Commit)
4e86195a
authored
Nis 12, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Mention access to ASTs
üst
e29002cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+14
-1
No files found.
Doc/whatsnew/whatsnew25.tex
Dosyayı görüntüle @
4e86195a
...
...
@@ -5,7 +5,6 @@
% Fix XXX comments
% Distutils upload (PEP 243)
% The easy_install stuff
% Access to ASTs with compile() flag
% Stateful codec changes
% ASCII is now default encoding for modules
...
...
@@ -1380,6 +1379,20 @@ no longer generate bytecode by traversing the parse tree. Instead
the parse tree is converted to an abstract syntax tree (or AST), and it is
the abstract syntax tree that's traversed to produce the bytecode.
It's possible for Python code to obtain AST objects by using the
\function
{
compile()
}
built-in and specifying 0x400 as the value of the
\var
{
flags
}
parameter:
\begin{verbatim}
ast = compile("""a=0
for i in range(10):
a += i
""", "<string>", 'exec', 0x0400)
assignment = ast.body[0]
for
_
loop = ast.body[1]
\end{verbatim}
No documentation has been written for the AST code yet. To start
learning about it, read the definition of the various AST nodes in
\file
{
Parser/Python.asdl
}
. A Python script reads this file and
...
...
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