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
39411f60
Kaydet (Commit)
39411f60
authored
Eki 24, 2011
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from Decimal module.
üst
037ffbf1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
34 deletions
+5
-34
decimal.py
Lib/decimal.py
+0
-22
test_decimal.py
Lib/test/test_decimal.py
+3
-12
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/decimal.py
Dosyayı görüntüle @
39411f60
...
...
@@ -3903,28 +3903,6 @@ class Context(object):
return
nc
__copy__
=
copy
# _clamp is provided for backwards compatibility with third-party
# code. May be removed in Python >= 3.3.
def
_get_clamp
(
self
):
"_clamp mirrors the clamp attribute. Its use is deprecated."
import
warnings
warnings
.
warn
(
'Use of the _clamp attribute is deprecated. '
'Please use clamp instead.'
,
DeprecationWarning
)
return
self
.
clamp
def
_set_clamp
(
self
,
clamp
):
"_clamp mirrors the clamp attribute. Its use is deprecated."
import
warnings
warnings
.
warn
(
'Use of the _clamp attribute is deprecated. '
'Please use clamp instead.'
,
DeprecationWarning
)
self
.
clamp
=
clamp
# don't bother with _del_clamp; no sane 3rd party code should
# be deleting the _clamp attribute
_clamp
=
property
(
_get_clamp
,
_set_clamp
)
def
_raise_error
(
self
,
condition
,
explanation
=
None
,
*
args
):
"""Handles an error
...
...
Lib/test/test_decimal.py
Dosyayı görüntüle @
39411f60
...
...
@@ -1834,18 +1834,9 @@ class ContextAPItests(unittest.TestCase):
# only, the attribute should be gettable/settable via both
# `clamp` and `_clamp`; in Python 3.3, `_clamp` should be
# removed.
c
=
Context
(
clamp
=
0
)
self
.
assertEqual
(
c
.
clamp
,
0
)
with
check_warnings
((
""
,
DeprecationWarning
)):
c
.
_clamp
=
1
self
.
assertEqual
(
c
.
clamp
,
1
)
with
check_warnings
((
""
,
DeprecationWarning
)):
self
.
assertEqual
(
c
.
_clamp
,
1
)
c
.
clamp
=
0
self
.
assertEqual
(
c
.
clamp
,
0
)
with
check_warnings
((
""
,
DeprecationWarning
)):
self
.
assertEqual
(
c
.
_clamp
,
0
)
c
=
Context
()
with
self
.
assertRaises
(
AttributeError
):
clamp_value
=
c
.
_clamp
def
test_abs
(
self
):
c
=
Context
()
...
...
Misc/NEWS
Dosyayı görüntüle @
39411f60
...
...
@@ -338,6 +338,8 @@ Core and Builtins
Library
-------
-
Issue
#
8540
:
Remove
deprecated
Context
.
_clamp
attribute
in
Decimal
module
.
-
Issue
#
13235
:
Added
PendingDeprecationWarning
to
warn
()
method
and
function
.
-
Issue
#
9168
:
now
smtpd
is
able
to
bind
privileged
port
.
...
...
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