summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unparse.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-44142: drop redundant parantheses when unparsing tuples as assignment ↵Batuhan Taskaya2021-05-161-0/+37
| | | | targets (GH-26156)
* bpo-44081: improve ast.unparse() for lambdas with no parameters (GH-26000)Batuhan Taskaya2021-05-151-0/+11
|
* bpo-43417: Better buffer handling for ast.unparse (GH-24772)Batuhan Taskaya2021-05-081-8/+27
|
* bpo-43892: Make match patterns explicit in the AST (GH-25585)Nick Coghlan2021-04-291-1/+2
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)Kodi Arfer2021-03-181-3/+12
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-28002: Roundtrip f-strings with ast.unparse better (#19612)Shantanu2020-11-201-13/+29
| | | | | | | | | By attempting to avoid backslashes in f-string expressions. We also now proactively raise errors for some backslashes we can't avoid while unparsing FormattedValues Co-authored-by: hauntsaninja <> Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-38870: invalid escape sequence (GH-20240)Batuhan Taskaya2020-05-191-1/+1
| | | | | `/home/isidentical/cpython/cpython/Lib/test/test_unparse.py:333: DeprecationWarning: invalid escape sequence \X` Automerge-Triggered-By: @pablogsal
* bpo-38870: Don't omit parenthesis when unparsing a slice in ast.unparseBatuhan Taskaya2020-05-181-1/+9
| | | | When unparsing a non-empty tuple, the parentheses can be safely omitted if there aren't any elements that explicitly require them (such as starred expressions).
* bpo-38870: correctly escape unprintable characters on ast.unparse (GH-20166)CyberSaxosTiGER2020-05-181-1/+5
| | | | | | | | | Unprintable characters such as `\x00` weren't correctly roundtripped due to not using default string repr when generating docstrings. This patch correctly encodes all unprintable characters (except `\n` and `\t`, which are commonly used for formatting, and found unescaped). Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-38870: Use subTest in test_unparse for better error reporting (GH-20141)Pablo Galindo2020-05-171-7/+11
|
* bpo-38870: Implement round tripping support for typed AST in ast.unparse ↵Batuhan Taskaya2020-05-161-2/+33
| | | | (GH-17797)
* bpo-38870: Correctly handle empty docstrings in ast.unparse (GH-18768)Batuhan Taskaya2020-05-161-2/+13
| | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38870: Don't put unnecessary parentheses on class declarations in ↵Batuhan Taskaya2020-05-161-1/+14
| | | | ast.parse (GH-20134)
* bpo-38870: Do not separate factor prefixes in ast.unparse (GH-20133)Batuhan Taskaya2020-05-161-1/+7
|
* bpo-38870: Don't start generated output with newlines in ast.unparse (GH-19636)Batuhan Taskaya2020-05-031-7/+5
|
* bpo-40334: unskip test_function_type in test_unparse with the new parser ↵Pablo Galindo2020-05-011-1/+0
| | | | (GH-19837)
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-291-1/+0
|
* bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)Victor Stinner2020-04-231-1/+1
| | | | | | | | | | | * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-0/+2
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-40209: Use tokenize.open in test_unparse (GH-19399)Hakan Çelik2020-04-161-5/+2
|
* bpo-38870: Implement support for ast.FunctionType in ast.unparse (GH-19016)Batuhan Taşkaya2020-03-151-3/+11
|
* bpo-38870: Simplify sequence interleaves in ast.unparse (GH-17892)Batuhan Taşkaya2020-03-091-14/+20
|
* bpo-39889: Fix ast.unparse() for subscript. (GH-18824)Serhiy Storchaka2020-03-071-0/+14
|
* bpo-38870: Add docstring support to ast.unparse (GH-17760)Batuhan Taşkaya2020-03-021-70/+126
| | | | | | Allow ast.unparse to detect docstrings in functions, modules and classes and produce nicely formatted unparsed output for said docstrings. Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38870: Implement a precedence algorithm in ast.unparse (GH-17377)Batuhan Taşkaya2020-03-011-0/+41
| | | | Implement a simple precedence algorithm for ast.unparse in order to avoid redundant parenthesis for nested structures in the final output.
* bpo-38870: Throw ValueError on invalid yield from usage (GH-17798)Batuhan Taşkaya2020-01-021-0/+2
|
* Fix error when running with -uall in test_unparse (GH-17739)Pablo Galindo2019-12-291-7/+7
|
* bpo-38870: Run always tests that heavily use grammar features in ↵Pablo Galindo2019-12-291-1/+11
| | | | test_unparse (GH-17738)
* Clean imports in test_unparse (GH-17545)Pablo Galindo2019-12-101-2/+0
|
* bpo-39003: Make sure all test are the same when using -R in test_unparse ↵Pablo Galindo2019-12-091-7/+14
| | | | (GH-17537)
* bpo-38870: Expose a function to unparse an ast object in the ast module ↵Pablo Galindo2019-11-241-0/+328
(GH-17302) Add ast.unparse() as a function in the ast module that can be used to unparse an ast.AST object and produce a string with code that would produce an equivalent ast.AST object when parsed.