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
0dd8f789
Kaydet (Commit)
0dd8f789
authored
Tem 08, 2010
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9136: Profiling Decimal gave 'dictionary changed size during iteration'.
Remove the use of locals() that caused this error.
üst
e42f1bb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
decimal.py
Lib/decimal.py
+31
-13
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/decimal.py
Dosyayı görüntüle @
0dd8f789
...
...
@@ -3813,20 +3813,38 @@ class Context(object):
Emin
=
None
,
Emax
=
None
,
capitals
=
None
,
clamp
=
None
,
_ignored_flags
=
None
):
if
flags
is
None
:
flags
=
[]
# Set defaults; for everything except flags and _ignored_flags,
# inherit from DefaultContext.
try
:
dc
=
DefaultContext
except
NameError
:
pass
self
.
prec
=
prec
if
prec
is
not
None
else
dc
.
prec
self
.
rounding
=
rounding
if
rounding
is
not
None
else
dc
.
rounding
self
.
Emin
=
Emin
if
Emin
is
not
None
else
dc
.
Emin
self
.
Emax
=
Emax
if
Emax
is
not
None
else
dc
.
Emax
self
.
capitals
=
capitals
if
capitals
is
not
None
else
dc
.
capitals
self
.
clamp
=
clamp
if
clamp
is
not
None
else
dc
.
clamp
if
_ignored_flags
is
None
:
_ignored_flags
=
[]
if
not
isinstance
(
flags
,
dict
):
flags
=
dict
([(
s
,
int
(
s
in
flags
))
for
s
in
_signals
])
if
traps
is
not
None
and
not
isinstance
(
traps
,
dict
):
traps
=
dict
([(
s
,
int
(
s
in
traps
))
for
s
in
_signals
])
for
name
,
val
in
locals
()
.
items
():
if
val
is
None
:
setattr
(
self
,
name
,
_copy
.
copy
(
getattr
(
DefaultContext
,
name
)))
else
:
setattr
(
self
,
name
,
val
)
del
self
.
self
self
.
_ignored_flags
=
[]
else
:
self
.
_ignored_flags
=
_ignored_flags
if
traps
is
None
:
self
.
traps
=
dc
.
traps
.
copy
()
elif
not
isinstance
(
traps
,
dict
):
self
.
traps
=
dict
((
s
,
int
(
s
in
traps
))
for
s
in
_signals
)
else
:
self
.
traps
=
traps
if
flags
is
None
:
self
.
flags
=
dict
.
fromkeys
(
_signals
,
0
)
elif
not
isinstance
(
flags
,
dict
):
self
.
flags
=
dict
((
s
,
int
(
s
in
flags
))
for
s
in
_signals
)
else
:
self
.
flags
=
flags
def
__repr__
(
self
):
"""Show the current context."""
...
...
Misc/NEWS
Dosyayı görüntüle @
0dd8f789
...
...
@@ -470,6 +470,10 @@ C-API
Library
-------
- Issue #9136: Fix 'dictionary changed size during iteration'
RuntimeError produced when profiling the decimal module. This was
due to a dangerous iteration over 'locals()' in Context.__init__.
- Fix extreme speed issue in Decimal.pow when the base is an exact
power of 10 and the exponent is tiny (for example,
Decimal(10) ** Decimal('1e-999999999')).
...
...
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