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
ee85339c
Kaydet (Commit)
ee85339c
authored
May 28, 2015
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
in dict displays, evaluate the key before the value (closes #11205)
Patch partially by Steve Dougherty.
üst
44e62586
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
5 deletions
+19
-5
_bootstrap_external.py
Lib/importlib/_bootstrap_external.py
+2
-1
test_compile.py
Lib/test/test_compile.py
+11
-0
NEWS
Misc/NEWS
+2
-0
ceval.c
Python/ceval.c
+2
-2
compile.c
Python/compile.c
+2
-2
importlib_external.h
Python/importlib_external.h
+0
-0
No files found.
Lib/importlib/_bootstrap_external.py
Dosyayı görüntüle @
ee85339c
...
@@ -221,12 +221,13 @@ _code_type = type(_write_atomic.__code__)
...
@@ -221,12 +221,13 @@ _code_type = type(_write_atomic.__code__)
# Python 3.4rc2 3310 (alter __qualname__ computation)
# Python 3.4rc2 3310 (alter __qualname__ computation)
# Python 3.5a0 3320 (matrix multiplication operator)
# Python 3.5a0 3320 (matrix multiplication operator)
# Python 3.5b1 3330 (PEP 448: Additional Unpacking Generalizations)
# Python 3.5b1 3330 (PEP 448: Additional Unpacking Generalizations)
# Python 3.5b2 3340 (fix dictionary display evaluation order #11205)
#
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
# due to the addition of new opcodes).
MAGIC_NUMBER
=
(
33
3
0
)
.
to_bytes
(
2
,
'little'
)
+
b
'
\r\n
'
MAGIC_NUMBER
=
(
33
4
0
)
.
to_bytes
(
2
,
'little'
)
+
b
'
\r\n
'
_RAW_MAGIC_NUMBER
=
int
.
from_bytes
(
MAGIC_NUMBER
,
'little'
)
# For import.c
_RAW_MAGIC_NUMBER
=
int
.
from_bytes
(
MAGIC_NUMBER
,
'little'
)
# For import.c
_PYCACHE
=
'__pycache__'
_PYCACHE
=
'__pycache__'
...
...
Lib/test/test_compile.py
Dosyayı görüntüle @
ee85339c
...
@@ -461,6 +461,17 @@ if 1:
...
@@ -461,6 +461,17 @@ if 1:
ast
.
body
=
[
_ast
.
BoolOp
()]
ast
.
body
=
[
_ast
.
BoolOp
()]
self
.
assertRaises
(
TypeError
,
compile
,
ast
,
'<ast>'
,
'exec'
)
self
.
assertRaises
(
TypeError
,
compile
,
ast
,
'<ast>'
,
'exec'
)
def
test_dict_evaluation_order
(
self
):
i
=
0
def
f
():
nonlocal
i
i
+=
1
return
i
d
=
{
f
():
f
(),
f
():
f
()}
self
.
assertEqual
(
d
,
{
1
:
2
,
3
:
4
})
@support.cpython_only
@support.cpython_only
def
test_same_filename_used
(
self
):
def
test_same_filename_used
(
self
):
s
=
"""def f(): pass
\n
def g(): pass"""
s
=
"""def f(): pass
\n
def g(): pass"""
...
...
Misc/NEWS
Dosyayı görüntüle @
ee85339c
...
@@ -10,6 +10,8 @@ Release date: 2015-07-05
...
@@ -10,6 +10,8 @@ Release date: 2015-07-05
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #11205: In dictionary displays, evaluate the key before the value.
- Issue #24285: Fixed regression that prevented importing extension modules
- Issue #24285: Fixed regression that prevented importing extension modules
from inside packages. Patch by Petr Viktorin.
from inside packages. Patch by Petr Viktorin.
...
...
Python/ceval.c
Dosyayı görüntüle @
ee85339c
...
@@ -2584,8 +2584,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
...
@@ -2584,8 +2584,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto
error
;
goto
error
;
while
(
--
oparg
>=
0
)
{
while
(
--
oparg
>=
0
)
{
int
err
;
int
err
;
PyObject
*
key
=
TOP
();
PyObject
*
value
=
TOP
();
PyObject
*
value
=
SECOND
();
PyObject
*
key
=
SECOND
();
STACKADJ
(
-
2
);
STACKADJ
(
-
2
);
err
=
PyDict_SetItem
(
map
,
key
,
value
);
err
=
PyDict_SetItem
(
map
,
key
,
value
);
Py_DECREF
(
value
);
Py_DECREF
(
value
);
...
...
Python/compile.c
Dosyayı görüntüle @
ee85339c
...
@@ -3138,8 +3138,8 @@ compiler_dict(struct compiler *c, expr_ty e)
...
@@ -3138,8 +3138,8 @@ compiler_dict(struct compiler *c, expr_ty e)
containers
++
;
containers
++
;
}
}
else
{
else
{
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
e
->
v
.
Dict
.
values
,
i
));
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
e
->
v
.
Dict
.
keys
,
i
));
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
e
->
v
.
Dict
.
keys
,
i
));
VISIT
(
c
,
expr
,
(
expr_ty
)
asdl_seq_GET
(
e
->
v
.
Dict
.
values
,
i
));
elements
++
;
elements
++
;
}
}
}
}
...
@@ -3287,8 +3287,8 @@ compiler_call_helper(struct compiler *c,
...
@@ -3287,8 +3287,8 @@ compiler_call_helper(struct compiler *c,
}
}
else
if
(
nsubkwargs
)
{
else
if
(
nsubkwargs
)
{
/* A keyword argument and we already have a dict. */
/* A keyword argument and we already have a dict. */
VISIT
(
c
,
expr
,
kw
->
value
);
ADDOP_O
(
c
,
LOAD_CONST
,
kw
->
arg
,
consts
);
ADDOP_O
(
c
,
LOAD_CONST
,
kw
->
arg
,
consts
);
VISIT
(
c
,
expr
,
kw
->
value
);
nseen
++
;
nseen
++
;
}
}
else
{
else
{
...
...
Python/importlib_external.h
Dosyayı görüntüle @
ee85339c
This diff is collapsed.
Click to expand it.
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