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
2b27c2dd
Kaydet (Commit)
2b27c2dd
authored
Ara 11, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issues #28916, #26483: Merge stdtypes.rst from 3.6
üst
274c01f0
0a7b8596
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
38 deletions
+20
-38
stdtypes.rst
Doc/library/stdtypes.rst
+14
-18
test_format.py
Lib/test/test_format.py
+6
-20
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
2b27c2dd
...
...
@@ -1644,18 +1644,20 @@ expression support in the :mod:`re` module).
Return true if all characters in the string are decimal
characters and there is at least one character, false
otherwise. Decimal characters are those
from general category "Nd". This category
includes digit characters, and all characters
that can be used to form decimal-radix numbers, e.g. U+0660,
ARABIC-INDIC DIGIT ZERO
.
otherwise. Decimal characters are those
that can be used to form
numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT
ZERO. Formally a decimal character is a character in the Unicode
General Category "Nd"
.
.. method:: str.isdigit()
Return true if all characters in the string are digits and there is at least one
character, false otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits. Formally, a digit
is a character that has the property value Numeric_Type=Digit or Numeric_Type=Decimal.
special handling, such as the compatibility superscript digits.
This covers digits which cannot be used to form numbers in base 10,
like the Kharosthi numbers. Formally, a digit is a character that has the
property value Numeric_Type=Digit or Numeric_Type=Decimal.
.. method:: str.isidentifier()
...
...
@@ -2199,15 +2201,12 @@ The conversion types are:
Notes:
(1)
The alternate form causes a leading zero (``'0'``) to be inserted between
left-hand padding and the formatting of the number if the leading character
of the result is not already a zero.
The alternate form causes a leading octal specifier (``'0o'``) to be
inserted before the first digit.
(2)
The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether
the ``'x'`` or ``'X'`` format was used) to be inserted between left-hand padding
and the formatting of the number if the leading character of the result is not
already a zero.
the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit.
(3)
The alternate form causes the result to always contain a decimal point, even if
...
...
@@ -3303,15 +3302,12 @@ The conversion types are:
Notes:
(1)
The alternate form causes a leading zero (``'0'``) to be inserted between
left-hand padding and the formatting of the number if the leading character
of the result is not already a zero.
The alternate form causes a leading octal specifier (``'0o'``) to be
inserted before the first digit.
(2)
The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on whether
the ``'x'`` or ``'X'`` format was used) to be inserted between left-hand padding
and the formatting of the number if the leading character of the result is not
already a zero.
the ``'x'`` or ``'X'`` format was used) to be inserted before the first digit.
(3)
The alternate form causes the result to always contain a decimal point, even if
...
...
Lib/test/test_format.py
Dosyayı görüntüle @
2b27c2dd
...
...
@@ -200,42 +200,28 @@ class FormatTest(unittest.TestCase):
testcommon
(
"
%#+37.34
o"
,
big
,
"+0o0012345670123456701234567012345670"
)
# next one gets one leading zero from precision
testcommon
(
"
%.33
o"
,
big
,
"012345670123456701234567012345670"
)
# base marker
shouldn't change that, since "0" is redundant
# base marker
added in spite of leading zero (different to Python 2)
testcommon
(
"
%#.33
o"
,
big
,
"0o012345670123456701234567012345670"
)
#
but reduce precision, and base marker should add a zero
#
reduce precision, and base marker is always added
testcommon
(
"
%#.32
o"
,
big
,
"0o12345670123456701234567012345670"
)
# one leading zero from precision,
and another
from "0" flag & width
testcommon
(
"
%03
4.33
o"
,
big
,
"
0012345670123456701234567012345670"
)
# base marker shouldn't change th
at
testcommon
(
"
%0#3
4
.33
o"
,
big
,
"0o012345670123456701234567012345670"
)
# one leading zero from precision,
plus two
from "0" flag & width
testcommon
(
"
%03
5.33
o"
,
big
,
"0
0012345670123456701234567012345670"
)
# base marker shouldn't change th
e size
testcommon
(
"
%0#3
5
.33
o"
,
big
,
"0o012345670123456701234567012345670"
)
# Some small ints, in both Python int and flavors).
testcommon
(
"
%
d"
,
42
,
"42"
)
testcommon
(
"
%
d"
,
-
42
,
"-42"
)
testcommon
(
"
%
d"
,
42
,
"42"
)
testcommon
(
"
%
d"
,
-
42
,
"-42"
)
testcommon
(
"
%
d"
,
42.0
,
"42"
)
testcommon
(
"
%#
x"
,
1
,
"0x1"
)
testcommon
(
"
%#
x"
,
1
,
"0x1"
)
testcommon
(
"
%#
X"
,
1
,
"0X1"
)
testcommon
(
"
%#
X"
,
1
,
"0X1"
)
testcommon
(
"
%#
o"
,
1
,
"0o1"
)
testcommon
(
"
%#
o"
,
1
,
"0o1"
)
testcommon
(
"
%#
o"
,
0
,
"0o0"
)
testcommon
(
"
%#
o"
,
0
,
"0o0"
)
testcommon
(
"
%
o"
,
0
,
"0"
)
testcommon
(
"
%
o"
,
0
,
"0"
)
testcommon
(
"
%
d"
,
0
,
"0"
)
testcommon
(
"
%
d"
,
0
,
"0"
)
testcommon
(
"
%#
x"
,
0
,
"0x0"
)
testcommon
(
"
%#
x"
,
0
,
"0x0"
)
testcommon
(
"
%#
X"
,
0
,
"0X0"
)
testcommon
(
"
%#
X"
,
0
,
"0X0"
)
testcommon
(
"
%
x"
,
0x42
,
"42"
)
testcommon
(
"
%
x"
,
-
0x42
,
"-42"
)
testcommon
(
"
%
x"
,
0x42
,
"42"
)
testcommon
(
"
%
x"
,
-
0x42
,
"-42"
)
testcommon
(
"
%
o"
,
0
o42
,
"42"
)
testcommon
(
"
%
o"
,
-
0
o42
,
"-42"
)
testcommon
(
"
%
o"
,
0
o42
,
"42"
)
testcommon
(
"
%
o"
,
-
0
o42
,
"-42"
)
# alternate float formatting
...
...
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