From 10f8ce66884cd7fee2372b8dae08ca8132091574 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 13 Mar 2019 13:00:46 -0700 Subject: bpo-36280: Add Constant.kind field (GH-12295) The value is a string for string and byte literals, None otherwise. It is 'u' for u"..." literals, 'b' for b"..." literals, '' for "..." literals. The 'r' (raw) prefix is ignored. Does not apply to f-strings. This appears sufficient to make mypy capable of using the stdlib ast module instead of typed_ast (assuming a mypy patch I'm working on). WIP: I need to make the tests pass. @ilevkivskyi @serhiy-storchaka https://bugs.python.org/issue36280 --- Parser/Python.asdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Parser') diff --git a/Parser/Python.asdl b/Parser/Python.asdl index 1ccd2ca223..c32b65a52f 100644 --- a/Parser/Python.asdl +++ b/Parser/Python.asdl @@ -78,7 +78,7 @@ module Python | Call(expr func, expr* args, keyword* keywords) | FormattedValue(expr value, int? conversion, expr? format_spec) | JoinedStr(expr* values) - | Constant(constant value) + | Constant(constant value, string? kind) -- the following expression can appear in assignment context | Attribute(expr value, identifier attr, expr_context ctx) -- cgit v1.2.1