Commit Graph

9 Commits

Author SHA1 Message Date
Eric V. Smith 6f6ff8a565
bpo-37050: Remove expr_text from FormattedValue ast node, use Constant node instead (GH-13597)
When using the "=" debug functionality of f-strings, use another Constant node (or a merged constant node) instead of adding expr_text to the FormattedValue node.
2019-05-27 15:31:52 -04:00
Pablo Galindo da6129e821
bpo-36961: Handle positional-only arguments in uparse.c (GH-13412) 2019-05-18 23:40:22 +01:00
Batuhan Taşkaya fa19a25c23 Add support for PEP572 in ast_unparse.c (GH-13337) 2019-05-18 23:10:20 +01:00
Eric V. Smith 9a4135e939
bpo-36817: Add f-string debugging using '='. (GH-13123)
If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression.
2019-05-08 16:28:48 -04:00
Serhiy Storchaka 2a2940e5c3
bpo-34854: Fix compiling string annotations containing lambdas. (GH-9645)
* Compiling a string annotation containing a lambda with keyword-only
argument without default value caused a crash.

* Remove the final "*" (it is incorrect syntax) in the representation of
lambda without *args and keyword-only arguments when compile from AST.

* Improve the representation of lambda without arguments.
2018-09-30 21:07:05 +03:00
Serhiy Storchaka 3f22811fef
bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445) 2018-09-27 17:42:37 +03:00
Serhiy Storchaka 64fddc423f bpo-33475: Fix and improve converting annotations to strings. (GH-6774) 2018-05-16 23:17:48 -04:00
Stéphane Wirtel 83ab995871 bpo-32711: Fix warnings for Python/ast_unparse.c (#5426)
* bpo-32711: Fix warnings for Python/ast_unparse.c
2018-02-01 17:59:27 +01:00
Guido van Rossum 95e4d58913 String annotations [PEP 563] (#4390)
* Document `from __future__ import annotations`
* Provide plumbing and tests for `from __future__ import annotations`
* Implement unparsing the AST back to string form

This is required for PEP 563 and as such only implements a part of the
unparsing process that covers expressions.
2018-01-26 08:20:18 -08:00