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
d752f7d8
Kaydet (Commit)
d752f7d8
authored
Kas 25, 2005
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
No need for types, use isinstance
üst
f9232678
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
misc.py
Lib/compiler/misc.py
+1
-2
pyassem.py
Lib/compiler/pyassem.py
+1
-2
pycodegen.py
Lib/compiler/pycodegen.py
+4
-5
No files found.
Lib/compiler/misc.py
Dosyayı görüntüle @
d752f7d8
import
types
def
flatten
(
tup
):
def
flatten
(
tup
):
elts
=
[]
elts
=
[]
for
elt
in
tup
:
for
elt
in
tup
:
if
type
(
elt
)
==
types
.
TupleType
:
if
isinstance
(
elt
,
tuple
)
:
elts
=
elts
+
flatten
(
elt
)
elts
=
elts
+
flatten
(
elt
)
else
:
else
:
elts
.
append
(
elt
)
elts
.
append
(
elt
)
...
...
Lib/compiler/pyassem.py
Dosyayı görüntüle @
d752f7d8
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
dis
import
dis
import
new
import
new
import
sys
import
sys
import
types
from
compiler
import
misc
from
compiler
import
misc
from
compiler.consts
\
from
compiler.consts
\
...
@@ -641,7 +640,7 @@ def getArgCount(args):
...
@@ -641,7 +640,7 @@ def getArgCount(args):
def
twobyte
(
val
):
def
twobyte
(
val
):
"""Convert an int argument into high and low bytes"""
"""Convert an int argument into high and low bytes"""
assert
type
(
val
)
==
types
.
IntType
assert
isinstance
(
val
,
int
)
return
divmod
(
val
,
256
)
return
divmod
(
val
,
256
)
class
LineAddrTable
:
class
LineAddrTable
:
...
...
Lib/compiler/pycodegen.py
Dosyayı görüntüle @
d752f7d8
...
@@ -3,7 +3,6 @@ import os
...
@@ -3,7 +3,6 @@ import os
import
marshal
import
marshal
import
struct
import
struct
import
sys
import
sys
import
types
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
from
compiler
import
ast
,
parse
,
walk
,
syntax
from
compiler
import
ast
,
parse
,
walk
,
syntax
...
@@ -1312,7 +1311,7 @@ class AbstractFunctionCode:
...
@@ -1312,7 +1311,7 @@ class AbstractFunctionCode:
def
generateArgUnpack
(
self
,
args
):
def
generateArgUnpack
(
self
,
args
):
for
i
in
range
(
len
(
args
)):
for
i
in
range
(
len
(
args
)):
arg
=
args
[
i
]
arg
=
args
[
i
]
if
type
(
arg
)
==
types
.
TupleType
:
if
isinstance
(
arg
,
tuple
)
:
self
.
emit
(
'LOAD_FAST'
,
'.
%
d'
%
(
i
*
2
))
self
.
emit
(
'LOAD_FAST'
,
'.
%
d'
%
(
i
*
2
))
self
.
unpackSequence
(
arg
)
self
.
unpackSequence
(
arg
)
...
@@ -1322,7 +1321,7 @@ class AbstractFunctionCode:
...
@@ -1322,7 +1321,7 @@ class AbstractFunctionCode:
else
:
else
:
self
.
emit
(
'UNPACK_TUPLE'
,
len
(
tup
))
self
.
emit
(
'UNPACK_TUPLE'
,
len
(
tup
))
for
elt
in
tup
:
for
elt
in
tup
:
if
type
(
elt
)
==
types
.
TupleType
:
if
isinstance
(
elt
,
tuple
)
:
self
.
unpackSequence
(
elt
)
self
.
unpackSequence
(
elt
)
else
:
else
:
self
.
_nameOp
(
'STORE'
,
elt
)
self
.
_nameOp
(
'STORE'
,
elt
)
...
@@ -1408,9 +1407,9 @@ def generateArgList(arglist):
...
@@ -1408,9 +1407,9 @@ def generateArgList(arglist):
count
=
0
count
=
0
for
i
in
range
(
len
(
arglist
)):
for
i
in
range
(
len
(
arglist
)):
elt
=
arglist
[
i
]
elt
=
arglist
[
i
]
if
type
(
elt
)
==
types
.
StringType
:
if
isinstance
(
elt
,
str
)
:
args
.
append
(
elt
)
args
.
append
(
elt
)
elif
type
(
elt
)
==
types
.
TupleType
:
elif
isinstance
(
elt
,
tuple
)
:
args
.
append
(
TupleArg
(
i
*
2
,
elt
))
args
.
append
(
TupleArg
(
i
*
2
,
elt
))
extra
.
extend
(
misc
.
flatten
(
elt
))
extra
.
extend
(
misc
.
flatten
(
elt
))
count
=
count
+
1
count
=
count
+
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