Uh oh!
There was an error while loading. Please reload this page.
Docs: Link tokens in the format string grammars - #108184
Conversation
Fix links from Format String Syntax grammar and Format Specification Mini-Language grammar to Python grammar. Also link `arg_name` token within Format String Syntax grammar.
wjandrea
commented
Aug 23, 2023
Looks like the links to |
AA-Turner
commented
Sep 10, 2023
skirpichev
commented
Jan 3, 2024
@wjandrea, could you, please, resolve merge conflicts? BTW, shouldn't we also bug sphinx-doc (I don't see related issue(s))? |
skirpichev
commented
Jan 3, 2024
This add hexadecimal floating point literals (IEEE 754-2008 §5.12.3) and
support construction of floats from hexadecimal strings. Note that the
float constructor accepts more permissive syntax (everything that is
currently accepted by the float.fromhex, but with a mandatory base
specifier; it also allows grouping digits with underscores).
Examples:
```pycon
>>> 0x1.1p-1
0.53125
>>> float('0x1.1')
1.0625
>>> 0x1.1
File "<stdin>", line 1
0x1.1
^
SyntaxError: invalid floating point literal
```
Minor changes:
* Py_ISDIGIT/ISXDIGIT macros were transformed to functions
* cherry-picked sphinx workaround from python#108184This add hexadecimal floating point literals (IEEE 754-2008 §5.12.3) and
support construction of floats from hexadecimal strings. Note that the
float constructor accepts more permissive syntax (everything that is
currently accepted by the float.fromhex, but with a mandatory base
specifier; it also allows grouping digits with underscores).
Examples:
```pycon
>>> 0x1.1p-1
0.53125
>>> float('0x1.1')
1.0625
>>> 0x1.1
File "<stdin>", line 1
0x1.1
^
SyntaxError: invalid floating point literal
```
Minor changes:
* Py_ISDIGIT/ISXDIGIT macros were transformed to functions
* cherry-picked sphinx workaround from python#108184@skirpichev merge conflicts resolved |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
skirpichev
commented
Jan 9, 2024
LGTM, except for two nitpicks |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Thanks @wjandrea for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
(cherry picked from commit f3d5d4a) Co-authored-by: William Andrea <william.j.andrea@gmail.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
(cherry picked from commit f3d5d4a) Co-authored-by: William Andrea <william.j.andrea@gmail.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
GH-113839 is a backport of this pull request to the 3.12 branch. |
GH-113840 is a backport of this pull request to the 3.11 branch. |
This add hexadecimal floating point literals (IEEE 754-2008 §5.12.3) and
support construction of floats from hexadecimal strings. Note that the
float constructor accepts more permissive syntax (everything that is
currently accepted by the float.fromhex, but with a mandatory base
specifier; it also allows grouping digits with underscores).
Examples:
```pycon
>>> 0x1.1p-1
0.53125
>>> float('0x1.1')
1.0625
>>> 0x1.1
File "<stdin>", line 1
0x1.1
^
SyntaxError: invalid floating point literal
```
Minor changes:
* Py_ISDIGIT/ISXDIGIT macros were transformed to functions
* cherry-picked sphinx workaround from python#108184This add hexadecimal floating point literals (IEEE 754-2008 §5.12.3) and
support construction of floats from hexadecimal strings. Note that the
float constructor accepts more permissive syntax (everything that is
currently accepted by the float.fromhex, but with a mandatory base
specifier; it also allows grouping digits with underscores).
Examples:
```pycon
>>> 0x1.1p-1
0.53125
>>> float('0x1.1')
1.0625
>>> 0x1.1
File "<stdin>", line 1
0x1.1
^
SyntaxError: invalid floating point literal
```
Minor changes:
* Py_ISDIGIT/ISXDIGIT macros were transformed to functions
* cherry-picked sphinx workaround from python#108184This add hexadecimal floating point literals (IEEE 754-2008 §5.12.3) and
support construction of floats from hexadecimal strings. Note that the
float constructor accepts more permissive syntax (everything that is
currently accepted by the float.fromhex, but with a mandatory base
specifier; it also allows grouping digits with underscores).
Examples:
```pycon
>>> 0x1.1p-1
0.53125
>>> float('0x1.1')
1.0625
>>> 0x1.1
File "<stdin>", line 1
0x1.1
^
SyntaxError: invalid floating point literal
```
Minor changes:
* Py_ISDIGIT/ISXDIGIT macros were transformed to functions
* cherry-picked sphinx workaround from python#108184Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Fix links from Format String Syntax grammar and Format Specification Mini-Language grammar to Python grammar.
Also link
arg_nametoken within Format String Syntax grammar.Please check my work. I'm not very familiar with RST, just read the docs on
productionlists and did my best.Should be backported to all current versions.
📚 Documentation preview 📚: https://cpython-previews--108184.org.readthedocs.build/en/108184/library/string.html#format-string-syntax