From 3673599eacabe1462e6f0ddbef98c61ad849baa3 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 18 Sep 2017 00:05:09 +0200 Subject: [PATCH 1/3] Add docs for Str.kind --- typed_ast/ast27.py | 5 ++--- typed_ast/ast3.py | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/typed_ast/ast27.py b/typed_ast/ast27.py index 4ba86673..a567f6c8 100644 --- a/typed_ast/ast27.py +++ b/typed_ast/ast27.py @@ -19,9 +19,8 @@ called with `mode=func_type`. - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. - - `Str` has a `has_b` boolean field which indicates if the string is - explicitly prefixed with a `b`. (This is deprecated and may be removed in - future versions.) + - `Str` has a `kind` string field which preseves the original string + prefix, so that ast27.parse('br"test"').body[0].value.kind == 'br'. An abstract syntax tree can be generated by using the `parse()` function from this module. The result will be a tree of objects whose diff --git a/typed_ast/ast3.py b/typed_ast/ast3.py index e44632cd..7a304b51 100644 --- a/typed_ast/ast3.py +++ b/typed_ast/ast3.py @@ -21,6 +21,8 @@ newer Python syntax features. - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. + - `Str` has a `kind` string field which preseves the original string + prefix, so that ast3.parse('u"test"').body[0].value.kind == 'u'. An abstract syntax tree can be generated by using the `parse()` function from this module. The result will be a tree of objects whose From 609ea1cb94aee177522fc5a37872d4b806ae69ab Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 18 Sep 2017 00:08:33 +0200 Subject: [PATCH 2/3] Fix a typo --- typed_ast/ast27.py | 2 +- typed_ast/ast3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typed_ast/ast27.py b/typed_ast/ast27.py index a567f6c8..ce5dd24a 100644 --- a/typed_ast/ast27.py +++ b/typed_ast/ast27.py @@ -19,7 +19,7 @@ called with `mode=func_type`. - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. - - `Str` has a `kind` string field which preseves the original string + - `Str` has a `kind` string field which preserves the original string prefix, so that ast27.parse('br"test"').body[0].value.kind == 'br'. An abstract syntax tree can be generated by using the `parse()` diff --git a/typed_ast/ast3.py b/typed_ast/ast3.py index 7a304b51..f6ced2e8 100644 --- a/typed_ast/ast3.py +++ b/typed_ast/ast3.py @@ -21,7 +21,7 @@ newer Python syntax features. - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. - - `Str` has a `kind` string field which preseves the original string + - `Str` has a `kind` string field which preserves the original string prefix, so that ast3.parse('u"test"').body[0].value.kind == 'u'. An abstract syntax tree can be generated by using the `parse()` From 33c0a50536255b2e921dafdeb3194a56269e00e5 Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 18 Sep 2017 00:10:34 +0200 Subject: [PATCH 3/3] Fix formatting --- typed_ast/ast27.py | 2 +- typed_ast/ast3.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typed_ast/ast27.py b/typed_ast/ast27.py index ce5dd24a..fd5c4ea7 100644 --- a/typed_ast/ast27.py +++ b/typed_ast/ast27.py @@ -20,7 +20,7 @@ - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. - `Str` has a `kind` string field which preserves the original string - prefix, so that ast27.parse('br"test"').body[0].value.kind == 'br'. + prefix, so that `ast27.parse('br"test"').body[0].value.kind == 'br'`. An abstract syntax tree can be generated by using the `parse()` function from this module. The result will be a tree of objects whose diff --git a/typed_ast/ast3.py b/typed_ast/ast3.py index f6ced2e8..ba3c0216 100644 --- a/typed_ast/ast3.py +++ b/typed_ast/ast3.py @@ -22,7 +22,7 @@ - `Module` has a `type_ignores` field which contains a list of lines which have been `# type: ignore`d. - `Str` has a `kind` string field which preserves the original string - prefix, so that ast3.parse('u"test"').body[0].value.kind == 'u'. + prefix, so that `ast3.parse('u"test"').body[0].value.kind == 'u'`. An abstract syntax tree can be generated by using the `parse()` function from this module. The result will be a tree of objects whose