Michael R. Crusoe pushed to branch upstream at Debian Med / python3-typed-ast
Commits: 527426f3 by Michael R. Crusoe at 2019-01-17T09:01:34Z New upstream version 1.2.0 - - - - - 8 changed files: - PKG-INFO - README.md - setup.py - typed_ast.egg-info/PKG-INFO - typed_ast/__init__.py - typed_ast/ast27.py - typed_ast/ast3.py - typed_ast/conversions.py Changes: ===================================== PKG-INFO ===================================== @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: typed-ast -Version: 1.1.1 +Version: 1.2.0 Summary: a fork of Python 2 and 3 ast modules with type comment support Home-page: https://github.com/python/typed_ast Author: David Fisher @@ -23,4 +23,5 @@ Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Software Development ===================================== README.md ===================================== @@ -9,11 +9,11 @@ parser similar to the standard `ast` library. Unlike `ast`, the parsers in comments and are independent of the version of Python under which they are run. The `typed_ast` parsers produce the standard Python AST (plus type comments), and are both fast and correct, as they are based on the CPython 2.7 and 3.6 -parsers. `typed_ast` runs on Python 3.3-3.6 on Linux, OS X and Windows. +parsers. `typed_ast` runs on Python 3.3-3.7 on Linux, OS X and Windows. ## Development Philosophy -This project is a drop-in replacement for the builtin `ast` module. It is +This project is a (mostly) drop-in replacement for the builtin `ast` module. It is intended to be bug-for-bug compatible and behave identically, except for the presence of a few additional fields on the returned classes and a few additional optional arguments to the `parse` call. Therefore, `typed_ast` will @@ -22,9 +22,22 @@ instead. To avoid feature bloat, any new features for `typed_ast` should have the potential to be broadly useful and not be built just for one niche usecase or in a manner such that only one project can use them. +### Incompatabilities + +For the purposes of *consuming* syntax trees, this should be a drop-in replacement. +It is not a drop-in replacement for users that wish to create or transform ASTs, +as a number of syntax tree classes have additional fields that must be populated +when constructing them. + +### Python 3.7 + +`typed_ast` has not yet been updated to be based on the Python 3.7 +parser. The main consequence of this that `await` and `async` are +not treated as keywords. + ## Submodules ### ast3 -The `ast3` parser produces the AST from the latest version of Python 3 +The `ast3` parser produces the AST from a recent version of Python 3 (currently Python 3.6). When new versions of Python 3 are released, it will be updated to match any changes in their AST. (For rationale and technical details, see [here](update_process.md).) The AST it currently produces is described in ===================================== setup.py ===================================== @@ -113,6 +113,7 @@ setup (name = 'typed-ast', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Topic :: Software Development', ], packages = ['typed_ast'], ===================================== typed_ast.egg-info/PKG-INFO ===================================== @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: typed-ast -Version: 1.1.1 +Version: 1.2.0 Summary: a fork of Python 2 and 3 ast modules with type comment support Home-page: https://github.com/python/typed_ast Author: David Fisher @@ -23,4 +23,5 @@ Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Topic :: Software Development ===================================== typed_ast/__init__.py ===================================== @@ -1 +1 @@ -__version__ = "1.1.1" +__version__ = "1.2.0" ===================================== typed_ast/ast27.py ===================================== @@ -283,7 +283,7 @@ class NodeTransformer(NodeVisitor): def visit_Name(self, node): return copy_location(Subscript( value=Name(id='data', ctx=Load()), - slice=Index(value=Str(s=node.id)), + slice=Index(value=Str(s=node.id, kind='')), ctx=node.ctx ), node) ===================================== typed_ast/ast3.py ===================================== @@ -53,8 +53,8 @@ def parse(source, filename='<unknown>', mode='exec', feature_version=LATEST_MINO fully supported for Python 3.5+ with partial support for Python 3.4. So, feature_version=3 or less are all equivalent to feature_version=4. - When feature_version=4, the parser will forbid the use of the async/await - keywords and the '@' operator, but will not forbid the use of PEP 448 + When feature_version=4, the parser will forbid the use of the async/await + keywords and the '@' operator, but will not forbid the use of PEP 448 additional unpacking generalizations, which were also added in Python 3.5. """ return _ast3._parse(source, filename, mode, feature_version) @@ -306,7 +306,7 @@ class NodeTransformer(NodeVisitor): def visit_Name(self, node): return copy_location(Subscript( value=Name(id='data', ctx=Load()), - slice=Index(value=Str(s=node.id)), + slice=Index(value=Str(s=node.id, kind='')), ctx=node.ctx ), node) ===================================== typed_ast/conversions.py ===================================== @@ -106,7 +106,8 @@ class _AST2To3(ast27.NodeTransformer): keywords.append(ast3.keyword("file", self.visit(n.dest))) if not n.nl: - keywords.append(ast3.keyword("end", ast3.Str(" ", lineno=n.lineno, col_offset=-1))) + keywords.append(ast3.keyword("end", + ast3.Str(s=" ", kind='', lineno=n.lineno, col_offset=-1))) return ast3.Expr(ast3.Call(ast3.Name("print", ast3.Load(), lineno=n.lineno, col_offset=-1), self.visit(n.values), @@ -218,7 +219,7 @@ class _AST2To3(ast27.NodeTransformer): if isinstance(s.s, bytes): return ast3.Bytes(s.s) else: - return ast3.Str(s.s) + return ast3.Str(s.s, s.kind) def visit_Num(self, n): new = self.generic_visit(n) View it on GitLab: https://salsa.debian.org/med-team/python3-typed-ast/commit/527426f3c6a38a258272d60d07aad684e9d89918 -- View it on GitLab: https://salsa.debian.org/med-team/python3-typed-ast/commit/527426f3c6a38a258272d60d07aad684e9d89918 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
