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
49061f7b
Kaydet (Commit)
49061f7b
authored
Agu 19, 2006
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Stomp out more hsa_key() calls.
üst
1b01e5c7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
25 deletions
+25
-25
misc.py
Lib/compiler/misc.py
+2
-2
pyassem.py
Lib/compiler/pyassem.py
+3
-3
symbols.py
Lib/compiler/symbols.py
+10
-10
transformer.py
Lib/compiler/transformer.py
+1
-1
visitor.py
Lib/compiler/visitor.py
+1
-1
_parseaddr.py
Lib/email/_parseaddr.py
+1
-1
message.py
Lib/email/message.py
+7
-7
No files found.
Lib/compiler/misc.py
Dosyayı görüntüle @
49061f7b
...
@@ -14,13 +14,13 @@ class Set:
...
@@ -14,13 +14,13 @@ class Set:
def
__len__
(
self
):
def
__len__
(
self
):
return
len
(
self
.
elts
)
return
len
(
self
.
elts
)
def
__contains__
(
self
,
elt
):
def
__contains__
(
self
,
elt
):
return
self
.
elts
.
has_key
(
elt
)
return
elt
in
self
.
elts
def
add
(
self
,
elt
):
def
add
(
self
,
elt
):
self
.
elts
[
elt
]
=
elt
self
.
elts
[
elt
]
=
elt
def
elements
(
self
):
def
elements
(
self
):
return
self
.
elts
.
keys
()
return
self
.
elts
.
keys
()
def
has_elt
(
self
,
elt
):
def
has_elt
(
self
,
elt
):
return
self
.
elts
.
has_key
(
elt
)
return
elt
in
self
.
elts
def
remove
(
self
,
elt
):
def
remove
(
self
,
elt
):
del
self
.
elts
[
elt
]
del
self
.
elts
[
elt
]
def
copy
(
self
):
def
copy
(
self
):
...
...
Lib/compiler/pyassem.py
Dosyayı görüntüle @
49061f7b
...
@@ -210,7 +210,7 @@ def dfs_postorder(b, seen):
...
@@ -210,7 +210,7 @@ def dfs_postorder(b, seen):
order
=
[]
order
=
[]
seen
[
b
]
=
b
seen
[
b
]
=
b
for
c
in
b
.
get_children
():
for
c
in
b
.
get_children
():
if
seen
.
has_key
(
c
)
:
if
c
in
seen
:
continue
continue
order
=
order
+
dfs_postorder
(
c
,
seen
)
order
=
order
+
dfs_postorder
(
c
,
seen
)
order
.
append
(
b
)
order
.
append
(
b
)
...
@@ -406,7 +406,7 @@ class PyFlowGraph(FlowGraph):
...
@@ -406,7 +406,7 @@ class PyFlowGraph(FlowGraph):
seen
=
{}
seen
=
{}
def
max_depth
(
b
,
d
):
def
max_depth
(
b
,
d
):
if
seen
.
has_key
(
b
)
:
if
b
in
seen
:
return
d
return
d
seen
[
b
]
=
1
seen
[
b
]
=
1
d
=
d
+
depth
[
b
]
d
=
d
+
depth
[
b
]
...
@@ -482,7 +482,7 @@ class PyFlowGraph(FlowGraph):
...
@@ -482,7 +482,7 @@ class PyFlowGraph(FlowGraph):
for
name
in
self
.
cellvars
:
for
name
in
self
.
cellvars
:
cells
[
name
]
=
1
cells
[
name
]
=
1
self
.
cellvars
=
[
name
for
name
in
self
.
varnames
self
.
cellvars
=
[
name
for
name
in
self
.
varnames
if
cells
.
has_key
(
name
)
]
if
name
in
cells
]
for
name
in
self
.
cellvars
:
for
name
in
self
.
cellvars
:
del
cells
[
name
]
del
cells
[
name
]
self
.
cellvars
=
self
.
cellvars
+
cells
.
keys
()
self
.
cellvars
=
self
.
cellvars
+
cells
.
keys
()
...
...
Lib/compiler/symbols.py
Dosyayı görüntüle @
49061f7b
...
@@ -49,9 +49,9 @@ class Scope:
...
@@ -49,9 +49,9 @@ class Scope:
def
add_global
(
self
,
name
):
def
add_global
(
self
,
name
):
name
=
self
.
mangle
(
name
)
name
=
self
.
mangle
(
name
)
if
self
.
uses
.
has_key
(
name
)
or
self
.
defs
.
has_key
(
name
)
:
if
name
in
self
.
uses
or
name
in
self
.
defs
:
pass
# XXX warn about global following def/use
pass
# XXX warn about global following def/use
if
self
.
params
.
has_key
(
name
)
:
if
name
in
self
.
params
:
raise
SyntaxError
,
"
%
s in
%
s is global and parameter"
%
\
raise
SyntaxError
,
"
%
s in
%
s is global and parameter"
%
\
(
name
,
self
.
name
)
(
name
,
self
.
name
)
self
.
globals
[
name
]
=
1
self
.
globals
[
name
]
=
1
...
@@ -88,14 +88,14 @@ class Scope:
...
@@ -88,14 +88,14 @@ class Scope:
The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
The scope of a name could be LOCAL, GLOBAL, FREE, or CELL.
"""
"""
if
self
.
globals
.
has_key
(
name
)
:
if
name
in
self
.
globals
:
return
SC_GLOBAL
return
SC_GLOBAL
if
self
.
cells
.
has_key
(
name
)
:
if
name
in
self
.
cells
:
return
SC_CELL
return
SC_CELL
if
self
.
defs
.
has_key
(
name
)
:
if
name
in
self
.
defs
:
return
SC_LOCAL
return
SC_LOCAL
if
self
.
nested
and
(
self
.
frees
.
has_key
(
name
)
or
if
self
.
nested
and
(
name
in
self
.
frees
or
self
.
uses
.
has_key
(
name
)
):
name
in
self
.
uses
):
return
SC_FREE
return
SC_FREE
if
self
.
nested
:
if
self
.
nested
:
return
SC_UNKNOWN
return
SC_UNKNOWN
...
@@ -108,8 +108,8 @@ class Scope:
...
@@ -108,8 +108,8 @@ class Scope:
free
=
{}
free
=
{}
free
.
update
(
self
.
frees
)
free
.
update
(
self
.
frees
)
for
name
in
self
.
uses
.
keys
():
for
name
in
self
.
uses
.
keys
():
if
not
(
self
.
defs
.
has_key
(
name
)
or
if
not
(
name
in
self
.
defs
or
self
.
globals
.
has_key
(
name
)
):
name
in
self
.
globals
):
free
[
name
]
=
1
free
[
name
]
=
1
return
free
.
keys
()
return
free
.
keys
()
...
@@ -134,7 +134,7 @@ class Scope:
...
@@ -134,7 +134,7 @@ class Scope:
free.
free.
"""
"""
self
.
globals
[
name
]
=
1
self
.
globals
[
name
]
=
1
if
self
.
frees
.
has_key
(
name
)
:
if
name
in
self
.
frees
:
del
self
.
frees
[
name
]
del
self
.
frees
[
name
]
for
child
in
self
.
children
:
for
child
in
self
.
children
:
if
child
.
check_name
(
name
)
==
SC_FREE
:
if
child
.
check_name
(
name
)
==
SC_FREE
:
...
...
Lib/compiler/transformer.py
Dosyayı görüntüle @
49061f7b
...
@@ -82,7 +82,7 @@ def extractLineNo(ast):
...
@@ -82,7 +82,7 @@ def extractLineNo(ast):
def
Node
(
*
args
):
def
Node
(
*
args
):
kind
=
args
[
0
]
kind
=
args
[
0
]
if
nodes
.
has_key
(
kind
)
:
if
kind
in
nodes
:
try
:
try
:
return
nodes
[
kind
](
*
args
[
1
:])
return
nodes
[
kind
](
*
args
[
1
:])
except
TypeError
:
except
TypeError
:
...
...
Lib/compiler/visitor.py
Dosyayı görüntüle @
49061f7b
...
@@ -84,7 +84,7 @@ class ExampleASTVisitor(ASTVisitor):
...
@@ -84,7 +84,7 @@ class ExampleASTVisitor(ASTVisitor):
meth
(
node
,
*
args
)
meth
(
node
,
*
args
)
elif
self
.
VERBOSE
>
0
:
elif
self
.
VERBOSE
>
0
:
klass
=
node
.
__class__
klass
=
node
.
__class__
if
not
self
.
examples
.
has_key
(
klass
)
:
if
klass
not
in
self
.
examples
:
self
.
examples
[
klass
]
=
klass
self
.
examples
[
klass
]
=
klass
print
print
print
self
.
visitor
print
self
.
visitor
...
...
Lib/email/_parseaddr.py
Dosyayı görüntüle @
49061f7b
...
@@ -109,7 +109,7 @@ def parsedate_tz(data):
...
@@ -109,7 +109,7 @@ def parsedate_tz(data):
return
None
return
None
tzoffset
=
None
tzoffset
=
None
tz
=
tz
.
upper
()
tz
=
tz
.
upper
()
if
_timezones
.
has_key
(
tz
)
:
if
tz
in
_timezones
:
tzoffset
=
_timezones
[
tz
]
tzoffset
=
_timezones
[
tz
]
else
:
else
:
try
:
try
:
...
...
Lib/email/message.py
Dosyayı görüntüle @
49061f7b
...
@@ -245,16 +245,16 @@ class Message:
...
@@ -245,16 +245,16 @@ class Message:
# BAW: should we accept strings that can serve as arguments to the
# BAW: should we accept strings that can serve as arguments to the
# Charset constructor?
# Charset constructor?
self
.
_charset
=
charset
self
.
_charset
=
charset
if
not
self
.
has_key
(
'MIME-Version'
)
:
if
'MIME-Version'
not
in
self
:
self
.
add_header
(
'MIME-Version'
,
'1.0'
)
self
.
add_header
(
'MIME-Version'
,
'1.0'
)
if
not
self
.
has_key
(
'Content-Type'
)
:
if
'Content-Type'
not
in
self
:
self
.
add_header
(
'Content-Type'
,
'text/plain'
,
self
.
add_header
(
'Content-Type'
,
'text/plain'
,
charset
=
charset
.
get_output_charset
())
charset
=
charset
.
get_output_charset
())
else
:
else
:
self
.
set_param
(
'charset'
,
charset
.
get_output_charset
())
self
.
set_param
(
'charset'
,
charset
.
get_output_charset
())
if
str
(
charset
)
<>
charset
.
get_output_charset
():
if
str
(
charset
)
<>
charset
.
get_output_charset
():
self
.
_payload
=
charset
.
body_encode
(
self
.
_payload
)
self
.
_payload
=
charset
.
body_encode
(
self
.
_payload
)
if
not
self
.
has_key
(
'Content-Transfer-Encoding'
)
:
if
'Content-Transfer-Encoding'
not
in
self
:
cte
=
charset
.
get_body_encoding
()
cte
=
charset
.
get_body_encoding
()
try
:
try
:
cte
(
self
)
cte
(
self
)
...
@@ -547,7 +547,7 @@ class Message:
...
@@ -547,7 +547,7 @@ class Message:
VALUE item in the 3-tuple) is always unquoted, unless unquote is set
VALUE item in the 3-tuple) is always unquoted, unless unquote is set
to False.
to False.
"""
"""
if
not
self
.
has_key
(
header
)
:
if
header
not
in
self
:
return
failobj
return
failobj
for
k
,
v
in
self
.
_get_params_preserve
(
failobj
,
header
):
for
k
,
v
in
self
.
_get_params_preserve
(
failobj
,
header
):
if
k
.
lower
()
==
param
.
lower
():
if
k
.
lower
()
==
param
.
lower
():
...
@@ -578,7 +578,7 @@ class Message:
...
@@ -578,7 +578,7 @@ class Message:
if
not
isinstance
(
value
,
tuple
)
and
charset
:
if
not
isinstance
(
value
,
tuple
)
and
charset
:
value
=
(
charset
,
language
,
value
)
value
=
(
charset
,
language
,
value
)
if
not
self
.
has_key
(
header
)
and
header
.
lower
()
==
'content-type'
:
if
header
not
in
self
and
header
.
lower
()
==
'content-type'
:
ctype
=
'text/plain'
ctype
=
'text/plain'
else
:
else
:
ctype
=
self
.
get
(
header
)
ctype
=
self
.
get
(
header
)
...
@@ -613,7 +613,7 @@ class Message:
...
@@ -613,7 +613,7 @@ class Message:
False. Optional header specifies an alternative to the Content-Type
False. Optional header specifies an alternative to the Content-Type
header.
header.
"""
"""
if
not
self
.
has_key
(
header
)
:
if
header
not
in
self
:
return
return
new_ctype
=
''
new_ctype
=
''
for
p
,
v
in
self
.
get_params
(
header
=
header
,
unquote
=
requote
):
for
p
,
v
in
self
.
get_params
(
header
=
header
,
unquote
=
requote
):
...
@@ -649,7 +649,7 @@ class Message:
...
@@ -649,7 +649,7 @@ class Message:
if
header
.
lower
()
==
'content-type'
:
if
header
.
lower
()
==
'content-type'
:
del
self
[
'mime-version'
]
del
self
[
'mime-version'
]
self
[
'MIME-Version'
]
=
'1.0'
self
[
'MIME-Version'
]
=
'1.0'
if
not
self
.
has_key
(
header
)
:
if
header
not
in
self
:
self
[
header
]
=
type
self
[
header
]
=
type
return
return
params
=
self
.
get_params
(
header
=
header
,
unquote
=
requote
)
params
=
self
.
get_params
(
header
=
header
,
unquote
=
requote
)
...
...
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