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
9047c8f7
Kaydet (Commit)
9047c8f7
authored
Eki 24, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF bug #1048870: call arg of lambda not updating
üst
7cb13a97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
test_compile.py
Lib/test/test_compile.py
+9
-0
NEWS
Misc/NEWS
+4
-1
compile.c
Python/compile.c
+2
-0
No files found.
Lib/test/test_compile.py
Dosyayı görüntüle @
9047c8f7
...
@@ -252,6 +252,15 @@ if 1:
...
@@ -252,6 +252,15 @@ if 1:
for
stmt
in
fail
:
for
stmt
in
fail
:
self
.
assertRaises
(
SyntaxError
,
compile
,
stmt
,
'tmp'
,
'exec'
)
self
.
assertRaises
(
SyntaxError
,
compile
,
stmt
,
'tmp'
,
'exec'
)
def
test_for_distinct_code_objects
(
self
):
# SF bug 1048870
def
f
():
f1
=
lambda
x
=
1
:
x
f2
=
lambda
x
=
2
:
x
return
f1
,
f2
f1
,
f2
=
f
()
self
.
assertNotEqual
(
id
(
f1
.
func_code
),
id
(
f2
.
func_code
))
def
test_main
():
def
test_main
():
test_support
.
run_unittest
(
TestSpecifics
)
test_support
.
run_unittest
(
TestSpecifics
)
...
...
Misc/NEWS
Dosyayı görüntüle @
9047c8f7
...
@@ -37,7 +37,10 @@ Core and builtins
...
@@ -37,7 +37,10 @@ Core and builtins
Extension Modules
Extension Modules
-----------------
-----------------
...
- Bug #1048870: the compiler now generates distinct code objects for
functions with identical bodies. This was producing confusing
traceback messages which pointed to the function where the code
object was first defined rather than the function being executed.
Library
Library
-------
-------
...
...
Python/compile.c
Dosyayı görüntüle @
9047c8f7
...
@@ -261,6 +261,8 @@ code_compare(PyCodeObject *co, PyCodeObject *cp)
...
@@ -261,6 +261,8 @@ code_compare(PyCodeObject *co, PyCodeObject *cp)
if
(
cmp
)
return
(
cmp
<
0
)
?-
1
:
1
;
if
(
cmp
)
return
(
cmp
<
0
)
?-
1
:
1
;
cmp
=
co
->
co_flags
-
cp
->
co_flags
;
cmp
=
co
->
co_flags
-
cp
->
co_flags
;
if
(
cmp
)
return
(
cmp
<
0
)
?-
1
:
1
;
if
(
cmp
)
return
(
cmp
<
0
)
?-
1
:
1
;
cmp
=
co
->
co_firstlineno
-
cp
->
co_firstlineno
;
if
(
cmp
)
return
(
cmp
<
0
)
?-
1
:
1
;
cmp
=
PyObject_Compare
(
co
->
co_code
,
cp
->
co_code
);
cmp
=
PyObject_Compare
(
co
->
co_code
,
cp
->
co_code
);
if
(
cmp
)
return
cmp
;
if
(
cmp
)
return
cmp
;
cmp
=
PyObject_Compare
(
co
->
co_consts
,
cp
->
co_consts
);
cmp
=
PyObject_Compare
(
co
->
co_consts
,
cp
->
co_consts
);
...
...
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