Docs: Link tokens in the format string grammars#108184
Merged
AA-Turner merged 8 commits intoJan 9, 2024
Merged
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.
Contributor
Author
|
Looks like the links to |
Member
AA-Turner
approved these changes
Sep 10, 2023
Member
|
@wjandrea, could you, please, resolve merge conflicts? BTW, shouldn't we also bug sphinx-doc (I don't see related issue(s))? |
Member
skirpichev
added a commit
to skirpichev/cpython
that referenced
this pull request
Jan 7, 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#108184
skirpichev
added a commit
to skirpichev/cpython
that referenced
this pull request
Jan 8, 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#108184
Contributor
Author
|
@skirpichev merge conflicts resolved |
skirpichev
reviewed
Jan 9, 2024
skirpichev
reviewed
Jan 9, 2024
skirpichev
approved these changes
Jan 9, 2024
Member
|
LGTM, except for two nitpicks |
AA-Turner
reviewed
Jan 9, 2024
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. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2024
(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>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2024
(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. |
AA-Turner
added a commit
that referenced
this pull request
Jan 9, 2024
…113840) Docs: Link tokens in the format string grammars (GH-108184) (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>
AA-Turner
added a commit
that referenced
this pull request
Jan 9, 2024
…113839) Docs: Link tokens in the format string grammars (GH-108184) (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>
skirpichev
added a commit
to skirpichev/cpython
that referenced
this pull request
Jan 9, 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#108184
skirpichev
added a commit
to skirpichev/cpython
that referenced
this pull request
Jan 9, 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#108184
skirpichev
added a commit
to skirpichev/cpython
that referenced
this pull request
Jan 14, 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#108184
kulikjak
pushed a commit
to kulikjak/cpython
that referenced
this pull request
Jan 22, 2024
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
aisk
pushed a commit
to aisk/cpython
that referenced
this pull request
Feb 11, 2024
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this pull request
Sep 2, 2024
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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