Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 8924234

Browse files
ilevkivskyigvanrossum
authored andcommitted
Add docs for Str.kind (#57)
1 parent d498191 commit 8924234

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

typed_ast/ast27.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
called with `mode=func_type`.
2020
- `Module` has a `type_ignores` field which contains a list of
2121
lines which have been `# type: ignore`d.
22-
- `Str` has a `has_b` boolean field which indicates if the string is
23-
explicitly prefixed with a `b`. (This is deprecated and may be removed in
24-
future versions.)
22+
- `Str` has a `kind` string field which preserves the original string
23+
prefix, so that `ast27.parse('br"test"').body[0].value.kind == 'br'`.
2524
2625
An abstract syntax tree can be generated by using the `parse()`
2726
function from this module. The result will be a tree of objects whose

typed_ast/ast3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
newer Python syntax features.
2222
- `Module` has a `type_ignores` field which contains a list of
2323
lines which have been `# type: ignore`d.
24+
- `Str` has a `kind` string field which preserves the original string
25+
prefix, so that `ast3.parse('u"test"').body[0].value.kind == 'u'`.
2426
2527
An abstract syntax tree can be generated by using the `parse()`
2628
function from this module. The result will be a tree of objects whose

0 commit comments

Comments
 (0)