-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
bpo-36817: Add f-string debugging using '='. #13123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
6797767
WIP: Mostly works, except repr isn't called (so only string expressio…
ericvsmith 93df017
WIP: Change !x to !d, to match an earlier discussion on python-ideas.
ericvsmith 99283dc
Call repr on the resulting expression. Change expr_source to expr_text.
ericvsmith 1b29503
Add simple tests.
ericvsmith 2684897
Remove FVC_DEBUG, which I thought I was going to use for this feature…
ericvsmith 42582d5
Fix some comments and formatting.
ericvsmith 1ffa2a1
Added blurb.
ericvsmith 14af246
Use quotes around the string result in the blurb text.
ericvsmith f985b10
Call out the conversion specifiers in monospace.
ericvsmith 4556421
Note that the repr of the expression is used.
ericvsmith 856485a
Fix conversion character.
ericvsmith a384516
Added Whats New entry.
ericvsmith 6107b54
Don't allow format_spec with !d.
ericvsmith 3f292c5
Test that we don't allow a format spec.
ericvsmith 0046262
Use repr(expr) if no format spec, use format(expr, spec) if one is.
ericvsmith a697d02
Pre-append the '=' to the end of expr_text at compile time, instead o…
ericvsmith 49d03e4
Add a coding comment, a note about why I'm using a unicode identifier…
ericvsmith f79e21d
Added tests for nested f-strings and for pre- and post-text.
ericvsmith ed82083
Add a test for newlines in expressions.
ericvsmith aeef3db
Clarify a comment.
ericvsmith caf3221
Change from di to =.
ericvsmith 921d8a1
Fix a comment.
ericvsmith bd65ec1
Fix comment.
ericvsmith 1acc386
Fix comments.
ericvsmith d46f83c
Skip all whitespace after the =, not just spaces. Handle unparsing.
ericvsmith abff2cb
Hack: Modify tests for f-string annotations. I'm not sure these are e…
ericvsmith 75ef1ac
Add missing FVC_ASCII.
ericvsmith e688fbf
Move the mapping from "no converion specified" to the exact conversion
ericvsmith 3e7e9ff
Make ast_unparse understand =.
ericvsmith 6a39185
Add a test for !s.
ericvsmith e32563c
Improve comments.
ericvsmith 9fe98cf
Update blurb for = syntax.
ericvsmith 6c62fce
Fix whatsnew.
ericvsmith d453f03
Fix comments about FVC_ values.
ericvsmith bb7d2e2
Restored some f-string tests, this time without !f.
ericvsmith 40231e6
Fix and improve a comment.
ericvsmith 34c2cf9
Use Py_ISSPACE instead of isspace.
ericvsmith 2dde0df
Fix parsing error with >= and <=. Add test for operators containing =.
ericvsmith 92a0b1a
< and > without a trailing = don't end an expression.
ericvsmith 0015f11
Add a clarifying comment about a test.
ericvsmith 46d4611
Add tests for named parameters, to exercise the = parsing.
ericvsmith 1bfb6e9
Improve the tests for named parameters.
ericvsmith 5fa0eac
Fix a typo in a comment.
ericvsmith 451cd27
Removed !f conversion. Switch to repr if using = and a format spec is…
ericvsmith 8e5a7c5
Add more tests for = and repr/format.
ericvsmith 8e73948
Fixed string annotations checks.
ericvsmith 0ec4dae
Removed unreachable code left over from !f.
ericvsmith 975f0f8
Removed 'f' type conversion.
ericvsmith 19fb7fa
Fixed a spurious space.
ericvsmith c3a8f12
Fixed whitespace.
ericvsmith dba7421
Address review findings.
ericvsmith 1a53ccd
Minor comments and variable renaming.
ericvsmith 19dc0d0
bpo-36816: Update the self-signed.pythontest.net cert (GH-13192)
gpshead File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
-----BEGIN CERTIFICATE----- | ||
M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6fVg2f8Bo9PdH9ihiIyxSrc+FOUasUYCCJvlSZ | ||
8hFUlLvcmrZlWuazohm0lsXuMK1JflmQr/DA/uXxP9xzFfRy+RU3jDyxJbRHAgMB | ||
AAGjUzBRMB0GA1UdDgQWBBSQJyxiPMRK01i+0BsV9zUwDiBaHzAfBgNVHSMEGDAW | ||
gBSQJyxiPMRK01i+0BsV9zUwDiBaHzAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 | ||
DQEBCwUAA4ICAQCR+7a7N/m+WLkxPPIA/CB4MOr2Uf8ixTv435Nyv6rXOun0+lTP | ||
ExSZ0uYQ+L0WylItI3cQHULldDueD+s8TGzxf5woaLKf6tqyr0NYhKs+UeNEzDnN | ||
9PHQIhX0SZw3XyXGUgPNBfRCg2ZDdtMMdOU4XlQN/IN/9hbYTrueyY7eXq9hmtI9 | ||
1srftAMqr9SR1JP7aHI6DVgrEsZVMTDnfT8WmLSGLlY1HmGfdEn1Ip5sbo9uSkiH | ||
AEPgPfjYIvR5LqTOMn4KsrlZyBbFIDh9Sl99M1kZzgH6zUGVLCDg1y6Cms69fx/e | ||
W1HoIeVkY4b4TY7Bk7JsqyNhIuqu7ARaxkdaZWhYaA2YyknwANdFfNpfH+elCLIk | ||
BUt5S3f4i7DaUePTvKukCZiCq4Oyln7RcOn5If73wCeLB/ZM9Ei1HforyLWP1CN8 | ||
XLfpHaoeoPSWIveI0XHUl65LsPN2UbMbul/F23hwl+h8+BLmyAS680Yhn4zEN6Ku | ||
B7Po90HoFa1Du3bmx4jsN73UkT/dwMTi6K072FbipnC1904oGlWmLwvAHvrtxxmL | ||
Pl3pvEaZIu8wa/PNF6Y7J7VIewikIJq6Ta6FrWeFfzMWOj2qA1ZZi6fUaDSNYvuV | ||
J5quYKCc/O+I/yDDf8wyBbZ/gvUXzUHTMYGG+bFrn1p7XDbYYeEJ6R/xEg== | ||
-----END CERTIFICATE----- |
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
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
7 changes: 7 additions & 0 deletions
7
Misc/NEWS.d/next/Core and Builtins/2019-05-02-11-48-08.bpo-36774.ZqbJ1J.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Add a ``=`` feature f-strings for debugging. This can precede ``!s``, | ||
``!r``, or ``!a``. It produces the text of the expression, followed by | ||
an equal sign, followed by the repr of the value of the expression. So | ||
``f'{3*9+15=}'`` would be equal to the string ``'3*9+15=42'``. If | ||
``=`` is specified, the default conversion is set to ``!r``, unless a | ||
format spec is given, in which case the formatting behavior is | ||
unchanged, and __format__ will be used. |
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Tests/2019-05-08-15-55-46.bpo-36816.WBKRGZ.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Update Lib/test/selfsigned_pythontestdotnet.pem to match self-signed.pythontest.net's new TLS certificate. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.