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
7caf908c
Kaydet (Commit)
7caf908c
authored
Agu 23, 2016
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #27832: Make _normalize parameter to Fraction.__init__ keyword-only.
üst
f4d28d43
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
fractions.py
Lib/fractions.py
+1
-1
test_fractions.py
Lib/test/test_fractions.py
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/fractions.py
Dosyayı görüntüle @
7caf908c
...
...
@@ -81,7 +81,7 @@ class Fraction(numbers.Rational):
__slots__
=
(
'_numerator'
,
'_denominator'
)
# We're immutable, so use __new__ not __init__
def
__new__
(
cls
,
numerator
=
0
,
denominator
=
None
,
_normalize
=
True
):
def
__new__
(
cls
,
numerator
=
0
,
denominator
=
None
,
*
,
_normalize
=
True
):
"""Constructs a Rational.
Takes a string like '3/2' or '1.5', another Rational instance, a
...
...
Lib/test/test_fractions.py
Dosyayı görüntüle @
7caf908c
...
...
@@ -150,6 +150,7 @@ class FractionTest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
F
,
"3/2"
,
3
)
self
.
assertRaises
(
TypeError
,
F
,
3
,
0
j
)
self
.
assertRaises
(
TypeError
,
F
,
3
,
1
j
)
self
.
assertRaises
(
TypeError
,
F
,
1
,
2
,
3
)
@requires_IEEE_754
def
testInitFromFloat
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
7caf908c
...
...
@@ -46,6 +46,9 @@ Core and Builtins
Library
-------
- Issue #27832: Make ``_normalize`` parameter to ``Fraction`` constuctor
keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
- Issue #27539: Fix unnormalised ``Fraction.__pow__`` result in the case
of negative exponent and negative base.
...
...
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