Skip to content

Docs: Link tokens in the format string grammars#108184

Merged
AA-Turner merged 8 commits into
python:mainfrom
wjandrea:wjandrea-patch_grammar-token-links
Jan 9, 2024
Merged

Docs: Link tokens in the format string grammars#108184
AA-Turner merged 8 commits into
python:mainfrom
wjandrea:wjandrea-patch_grammar-token-links

Conversation

@wjandrea

@wjandrea wjandrea commented Aug 20, 2023

Copy link
Copy Markdown
Contributor

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.


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

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.
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir skip news awaiting review labels Aug 20, 2023
@AA-Turner AA-Turner added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Aug 21, 2023
@wjandrea

Copy link
Copy Markdown
Contributor Author

Looks like the links to python-grammar didn't work. I'm not sure if that's cause the test failed or what.

@AA-Turner

Copy link
Copy Markdown
Member

See #109209 and #109210.

@AA-Turner AA-Turner changed the title Docs: Fix grammar token links in string.rst Docs: Link grammar token links in string.rst Sep 10, 2023
@AA-Turner AA-Turner changed the title Docs: Link grammar token links in string.rst Docs: Link tokens in the format string grammars Sep 10, 2023
@skirpichev

Copy link
Copy Markdown
Member

@wjandrea, could you, please, resolve merge conflicts?

BTW, shouldn't we also bug sphinx-doc (I don't see related issue(s))?

@skirpichev

Copy link
Copy Markdown
Member

FYI: sphinx-doc/sphinx#11854

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
@wjandrea

wjandrea commented Jan 9, 2024

Copy link
Copy Markdown
Contributor Author

@skirpichev merge conflicts resolved

Comment thread Doc/library/string.rst Outdated
Comment thread Doc/tools/extensions/pyspecific.py
@skirpichev

Copy link
Copy Markdown
Member

LGTM, except for two nitpicks

@AA-Turner?

Comment thread Doc/tools/extensions/pyspecific.py
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@AA-Turner AA-Turner enabled auto-merge (squash) January 9, 2024 02:41
@AA-Turner AA-Turner merged commit f3d5d4a into python:main Jan 9, 2024
@miss-islington-app

Copy link
Copy Markdown

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>
@bedevere-app

bedevere-app Bot commented Jan 9, 2024

Copy link
Copy Markdown

GH-113839 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 9, 2024
@bedevere-app

bedevere-app Bot commented Jan 9, 2024

Copy link
Copy Markdown

GH-113840 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Jan 9, 2024
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>
@wjandrea wjandrea deleted the wjandrea-patch_grammar-token-links branch January 9, 2024 04:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants