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
e8814fbb
Kaydet (Commit)
e8814fbb
authored
Eyl 10, 2010
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
As per python-dev discussion with Eli, properly document and publish dis.show_code
üst
c02adca9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
dis.rst
Doc/library/dis.rst
+11
-1
dis.py
Lib/dis.py
+2
-6
No files found.
Doc/library/dis.rst
Dosyayı görüntüle @
e8814fbb
...
...
@@ -36,7 +36,7 @@ the following command can be used to get the disassembly of :func:`myfunc`::
The :mod:`dis` module defines the following functions and constants:
.. function:: code_info(x
=None
)
.. function:: code_info(x)
Return a formatted multi-line string with detailed code object information
for the supplied function, method, source code string or code object.
...
...
@@ -48,6 +48,16 @@ The :mod:`dis` module defines the following functions and constants:
.. versionadded:: 3.2
.. function:: show_code(x)
Print detailed code object information for the supplied function, method,
source code string or code object to stdout.
This is a convenient shorthand for ``print(code_info(x))``, intended for
interactive exploration at the interpreter prompt.
.. versionadded:: 3.2
.. function:: dis(x=None)
Disassemble the *x* object. *x* can denote either a module, a class, a
...
...
Lib/dis.py
Dosyayı görüntüle @
e8814fbb
...
...
@@ -7,7 +7,7 @@ from opcode import *
from
opcode
import
__all__
as
_opcodes_all
__all__
=
[
"code_info"
,
"dis"
,
"disassemble"
,
"distb"
,
"disco"
,
"findlinestarts"
,
"findlabels"
]
+
_opcodes_all
"findlinestarts"
,
"findlabels"
,
"show_code"
]
+
_opcodes_all
del
_opcodes_all
_have_code
=
(
types
.
MethodType
,
types
.
FunctionType
,
types
.
CodeType
,
type
)
...
...
@@ -140,12 +140,8 @@ def _format_code_info(co):
lines
.
append
(
"
%4
d:
%
s"
%
i_n
)
return
"
\n
"
.
join
(
lines
)
# show_code is deliberately undocumented and left out of __all__,
# since it doesn't offer any real benefit over code_info() above
# It is only retained because it already existed and was not
# marked as private in previous versions of Python
def
show_code
(
co
):
"""
Show details about a code objec
t."""
"""
Print details of methods, functions, or code to stdou
t."""
print
(
code_info
(
co
))
def
disassemble
(
co
,
lasti
=-
1
):
...
...
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