GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — gh-141174: Test `type_repr()` of `Template` with invalid syntax in `Interpolation` by dr-carlos · Pull Request #155661 · python/cpython Conversation
|
| except SyntaxError: | |
| return _template_to_ast_constructor(template) |
These ensure that a reasonable value is returned when stringifying a Template annotation containing invalid syntax.
This could be tested for both get_annotations(format=Format.STRING) and type_repr(). But, it's impossible from a syntactic t-string and only possbile through artificial Template construction, which is only currently tested within the type_repr() tests. So I've only added a test there. Happy to add them in other places if that's required.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @dr-carlos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-155711 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-155712 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… in `Interpolation` (python#155661) Test `type_repr()` of `Template` with invalid syntax in `Interpolation`
…x in `Interpolation` (GH-155661) (#155711) Co-authored-by: dr-carlos <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.