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
f6595983
Kaydet (Commit)
f6595983
authored
Mar 12, 2017
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Mar 12, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
üst
1989763f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
3.7.rst
Doc/whatsnew/3.7.rst
+4
-0
gettext.py
Lib/gettext.py
+4
-0
test_gettext.py
Lib/test/test_gettext.py
+6
-3
NEWS
Misc/NEWS
+3
-0
No files found.
Doc/whatsnew/3.7.rst
Dosyayı görüntüle @
f6595983
...
...
@@ -180,6 +180,10 @@ Deprecated
both deprecated in Python 3.4 now emit :exc:`DeprecationWarning`. (Contributed
by Matthias Bussonnier in :issue:`29576`)
- Using non-integer value for selecting a plural form in :mod:`gettext` is
now deprecated. It never correctly worked.
(Contributed by Serhiy Storchaka in :issue:`28692`.)
Removed
=======
...
...
Lib/gettext.py
Dosyayı görüntüle @
f6595983
...
...
@@ -164,6 +164,10 @@ def _as_int(n):
except
TypeError
:
raise
TypeError
(
'Plural value must be an integer, got
%
s'
%
(
n
.
__class__
.
__name__
,))
from
None
import
warnings
warnings
.
warn
(
'Plural value must be an integer, got
%
s'
%
(
n
.
__class__
.
__name__
,),
DeprecationWarning
,
4
)
return
n
def
c2py
(
plural
):
...
...
Lib/test/test_gettext.py
Dosyayı görüntüle @
f6595983
...
...
@@ -443,9 +443,12 @@ class PluralFormsTestCase(GettextBaseTest):
f
=
gettext
.
c2py
(
'n != 1'
)
self
.
assertEqual
(
f
(
1
),
0
)
self
.
assertEqual
(
f
(
2
),
1
)
self
.
assertEqual
(
f
(
1.0
),
0
)
self
.
assertEqual
(
f
(
2.0
),
1
)
self
.
assertEqual
(
f
(
1.1
),
1
)
with
self
.
assertWarns
(
DeprecationWarning
):
self
.
assertEqual
(
f
(
1.0
),
0
)
with
self
.
assertWarns
(
DeprecationWarning
):
self
.
assertEqual
(
f
(
2.0
),
1
)
with
self
.
assertWarns
(
DeprecationWarning
):
self
.
assertEqual
(
f
(
1.1
),
1
)
self
.
assertRaises
(
TypeError
,
f
,
'2'
)
self
.
assertRaises
(
TypeError
,
f
,
b
'2'
)
self
.
assertRaises
(
TypeError
,
f
,
[])
...
...
Misc/NEWS
Dosyayı görüntüle @
f6595983
...
...
@@ -270,6 +270,9 @@ Extension Modules
Library
-------
- bpo-28692: Using non-integer value for selecting a plural form in gettext is
now deprecated.
- bpo-26121: Use C library implementation for math functions:
tgamma(), lgamma(), erf() and erfc().
...
...
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