| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
(GH-133761)
(cherry picked from commit 076004ae5461cf3a7fe248a38e28afff33acdd14)
Co-authored-by: Yongzi Li <1538321957@qq.com>
|
| |
|
|
|
| |
specification docs (GH-132030) (#132123)
(cherry picked from commit 06a110f5227ba9d52f6205fde55924a14cab36ff)
|
| |
|
|
|
|
|
|
| |
POSIX sense (GH-128820) (#128868)
gh-67206: Document that `string.printable` is not printable in the POSIX sense (GH-128820)
(cherry picked from commit d906bde250d59c396d8dab92285b832c66cdec27)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.
---------
(cherry picked from commit e2325c9db0650fc06d909eb2b5930c0573f24f71)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#126334)
The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.
If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf(). Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().
(cherry picked from commit 7d7d56d8b1147a6b85e1c09d01b164df7c5c4942)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
(#126128)
gh-122767: document "new style" formatting for complexes (GH-122848)
(cherry picked from commit 0bbbe15f5688552236c48f2b6e320c5312720b8e)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
(GH-125426) (#125428)
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
(cherry picked from commit cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-123561) (#124596)
gh-123560: Correct docs for "empty" format type for floats (GH-123561)
(cherry picked from commit 274d9ab619b8150a613275835234ea9ef935f21f)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
| |
|
|
|
| |
point" (GH-121907) (GH-122012)
(cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
|
| |
|
|
|
|
|
|
| |
(GH-117099) (#118790)
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8ff41b5ec5d879ee0b6651f146a66151)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
|
| |
|
|
| |
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
| |
|
| |
Fix wrong indentation in the Doc/library dir.
|
| |
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| | |
|
| | |
|
| |
|
| |
Reported by Damian Dureck: https://mail.python.org/archives/list/docs@python.org/thread/UZTWBJIXC3MBKTHXVTIBPGDPKBNWZ5LN/
|
| |
|
|
|
|
| |
There's an extra underlines that messed the rest of the documentation rendering.
Closes #95685
|
| |
|
|
|
|
|
|
|
|
| |
(GH-95527)
If an HTTP link is redirected to a same looking HTTPS link, the latter can
be used directly without changes in readability and behavior.
It protects from a men-in-the-middle attack.
This change does not affect Python examples.
|
| |
|
|
|
|
|
|
| |
Add "z" format specifier to coerce negative 0 to zero.
See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995) for discussion.
This covers `str.format()` and f-strings. Old-style string interpolation is not supported.
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* `precision` field is a decimal integer
* clarify that stated limitations are on presentation type
rather than input value type. Especially misleading is
"precision is not allowed for integer values", since integer
value input to a format like `.1f` is fine.
* regarding max field size, replace "non-number" with "string",
which is the only non-numeric presentation type
Automerge-Triggered-By: GH:ericvsmith
|
| |
|
|
|
| |
Add `string.Template.get_identifiers()` method that returns the identifiers within the template. By default, raises an error if it encounters an invalid identifier (like `substitute()`). The keyword-only argument `raise_on_invalid` can be set to `False` to ignore invalid identifiers (like `safe_substitute()`).
Automerge-Triggered-By: GH:warsaw
|
| |
|
|
|
|
|
| |
(GH-25941)
* clearly document that ":#X" string formatting results in "0X..."
* put back the "serial comma"
|
| |
|
|
| |
expressions (#25053)
|
| |
|
|
| |
Previously it was an error with confusing error message.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
* Improve description of 'e', 'f' and 'g' presentation types
* Drop the 'E' from Scientific 'E' notation; remove >= 0 qualifications
* Fix false statement that the alternate form is valid for Decimal
* Nitpick: remove the Harvard/Oxford comma
* Add note that the decimal point is also removed if no digits follow it, except in alternate form
|
| |
|
|
|
|
|
| |
Use an unique identifier for the different grammars documented using
the Sphinx productionlist markup.
productionlist markups of the same grammar, like "expressions" or
"compound statements", use the same identifier "python-grammar".
|
| |
|
|
|
|
|
|
| |
Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:
Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Make the definition of the width more explicit that it includes any
extra signs added by other options.
https://bugs.python.org/issue38657
Automerge-Triggered-By: @Mariatta
|
| | |
|
| | |
|
| |
|
|
|
| |
Subsequent -> subsequent
https://bugs.python.org/issue36168
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-34273: Change 'Fixed point' to 'Fixed-point notation'.
The change in the mini language floating point and decimal table
is consistent with 'Exponential notation' and clarifies that we
are referring to the output notation, not an object type.
* Update string.rst
* Update string.rst
* Update string.rst
* Update string.rst
|
| |
|
|
|
| |
string.Formatter auto-numbering feature was added in 3.4 and there
is no versionchanged note in its documentation, making the documentation
ambiguous about which version the feature is available.
|
| |
|
|
| |
`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
|
| |
|
|
|
| |
mini-language doc (GH-5482)
Changed the definition of width and precision from "integer" to "digit+" in format mini-language doc.
|
| |
|
|
| |
Overriding flags to 0 will make the default pattern matching only
lower case letters.
|
| |
|
| |
Add one last minor clarification for idpattern
|
| |
|
|
| |
This sentence is removed while backporting to 3.6 branch.
See https://github.com/python/cpython/pull/3982#discussion_r144555768
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-3872)
Pattern `[a-z]` with `IGNORECASE` flag can match to some non-ASCII characters.
Straightforward solution for this is using `IGNORECASE | ASCII` flag.
But users may subclass `Template` and override only `idpattern`. So we want to
avoid changing `Template.flags`.
So this commit uses local flag `-i` for `idpattern` and change `[a-z]` to `[a-zA-Z]`.
|
| |
|
|
|
|
|
|
| |
* bpo-1198569: Allow the braced pattern to be different
``string.Template`` subclasses can optionally define ``braceidpattern`` if
they want to specify different placeholder patterns inside and outside the
braces. If None (the default) it falls back to ``idpattern``.
|
| |
|
|
|
| |
bpo-19824
bpo-20314
bpo-12518
|
| |
|
|
| |
is now positional-only.
|