Commit Graph

134 Commits

Author SHA1 Message Date
Łukasz Langa 1b9530c536 bpo-23894: make lib2to3 recognize f-strings (#1733)
Note: this doesn't unpack f-strings into the underlying JoinedStr AST.

Ideally we'd fully implement JoinedStr here but given its additional
complexity, I think this is worth bandaiding as is. This unblocks tools like
https://github.com/google/yapf to format 3.6 syntax using f-strings.
2017-05-22 16:35:48 -07:00
Łukasz Langa 0c4aca54dc Make rb'' strings work in lib2to3 (#1724)
This partially solves bpo-23894.
2017-05-22 15:19:09 -07:00
Nevada Sanchez a6e395dffa bpo-29869: Allow underscores in numeric literals in lib2to3. (GH-1119)
* Allow underscores in numeric literals in lib2to3.
* Stricter literal parsing for Python 3.6 in lib2to3.pgen2.tokenize.
* Add test case for underscores in literals in Python 3.
2017-04-13 10:32:54 -07:00
Stuart Berg 93b4b47e3a bpo-28837: Fix lib2to3 handling of map/zip/filter calls when followed with a 'trailer', e.g. zip()[x] (#24) 2017-04-05 22:19:40 -07:00
Serhiy Storchaka 70d28a184c Remove unused imports. 2016-12-16 20:00:15 +02:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 3b822d6c89 Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
2016-09-09 18:19:51 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 28325749c0 Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
2016-09-09 18:18:52 -07:00
Gregory P. Smith dbdf029a55 remove fix_callable - callable() was readded many releases ago. 2016-09-09 18:14:33 -07:00
Gregory P. Smith 223f12c9eb Remove 2to3's fix_callable... We reintroduced the callable built-in
pretty early on in the 3.x series (3.1 or 3.2?).
2016-09-09 17:03:58 -07:00
Gregory P. Smith fa40ca811f issue27985 - fix the incorrect duplicate class name in the lib2to3
test.  call it TestVarAnnotations instead.
2016-09-09 14:48:08 -07:00
Yury Selivanov 52c4e7cc84 Issue #28008: Implement PEP 530 -- asynchronous comprehensions. 2016-09-09 10:36:01 -07:00
Yury Selivanov f8cb8a16a3 Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.
Patch by Ivan Levkivskyi.
2016-09-08 20:50:03 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) dd1c638b92 lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
between runs given the same Grammar.txt input regardless of the hash
randomization setting.
2016-09-08 00:40:07 +00:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) a68c1bca7b Remove legacy "from __future__ import with_statement" lines. 2016-09-08 13:47:41 -07:00
Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) 0c578d62fc lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
between runs given the same Grammar.txt input regardless of the hash
randomization setting.
2016-09-08 00:46:26 +00:00
Serhiy Storchaka 64204de04c Issue #27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.
Patch by Demur Rumed.
2016-06-12 17:36:24 +03:00
Martin Panter 50d4c15ba7 Issue #27030: Merge RE fix from 3.5 2016-06-12 06:08:29 +00:00
Martin Panter d4704803b9 Fix buggy RE “\parrot_example.py”, uncovered by Issue #27030 2016-06-12 06:07:35 +00:00
Terry Jan Reedy cc20d63e64 Merge with 3.5 2016-05-06 15:58:13 -04:00
Terry Jan Reedy 823c626b43 Issue 26911: fix import (other problems remain). 2016-05-06 15:57:57 -04:00
Serhiy Storchaka a6f26c1d34 Remove more unused imports in tests. 2016-04-25 00:05:30 +03:00
Serhiy Storchaka e437a10d15 Issue #23277: Remove unused imports in tests. 2016-04-24 21:41:02 +03:00
Serhiy Storchaka c7f44aa99a Issue #23277: Remove more unused sys and os imports. 2016-04-24 13:25:01 +03:00
Yury Selivanov 38d3876bfb Merge 3.5 (Issue #24619) 2015-07-23 15:02:25 +03:00
Yury Selivanov 96ec934e75 Issue #24619: Simplify async/await tokenization.
This commit simplifies async/await tokenization in tokenizer.c,
tokenize.py & lib2to3/tokenize.py.  Previous solution was to keep
a stack of async-def & def blocks, whereas the new approach is just
to remember position of the outermost async-def block.

This change won't bring any parsing performance improvements, but
it makes the code much easier to read and validate.
2015-07-23 15:01:58 +03:00
Robert Collins d4f4a6dddb Issue #13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond. 2015-07-23 06:19:18 +12:00
Yury Selivanov 7544508f02 PEP 0492 -- Coroutines with async and await syntax. Issue #24017. 2015-05-11 22:57:16 -04:00
Zachary Ware 2acbae8016 Issue #22173: Update lib2to3 tests to use unittest test discovery. 2014-10-29 12:24:59 -05:00
Berker Peksag f23530f569 Issue #22186: Fix typos in Lib/.
Patch by Févry Thibault.
2014-10-19 18:04:38 +03:00
Benjamin Peterson 0654be18b3 teach 2to3 about 'yield from' 2014-04-10 00:23:18 -04:00
Benjamin Peterson 4ab92c800a add matrix multiplication operator support to 2to3 2014-04-10 00:12:47 -04:00
Serhiy Storchaka 8f8ec92de8 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang lines in the unittestgui and checkpip scripts.
2014-01-16 17:33:23 +02:00
Serhiy Storchaka b992a0e102 Issue #19936: Added executable bits or shebang lines to Python scripts which
requires them.  Disable executable bits and shebang lines in test and
benchmark files in order to prevent using a random system python, and in
source files of modules which don't provide command line interface.  Fixed
shebang line to use python3 executable in the unittestgui script.
2014-01-16 17:15:49 +02:00
Ezio Melotti 6bdd98622e #10712: 2to3 has a new "asserts" fixer that replaces deprecated names of unittest methods. 2013-11-23 21:14:42 +02:00
Serhiy Storchaka 8bdc130121 Issue #19592: Use specific asserts in lib2to3 tests. 2013-11-14 23:49:58 +02:00
Serhiy Storchaka 1eadd6a120 Issue #19592: Use specific asserts in lib2to3 tests. 2013-11-14 23:50:51 +02:00
Serhiy Storchaka 1322f9e2d1 Issue #18037: Do not escape '\u' and '\U' in raw strings. 2013-10-08 21:08:48 +03:00
Serhiy Storchaka 5e596769b0 Issue #18037: Do not escape '\u' and '\U' in raw strings. 2013-10-08 21:07:46 +03:00
Serhiy Storchaka 026af2a597 Issue #18037: 2to3 now escapes '\u' and '\U' in native strings. 2013-10-03 12:10:49 +03:00
Serhiy Storchaka def0a4c298 Issue #18037: 2to3 now escapes '\u' and '\U' in native strings. 2013-10-03 12:08:38 +03:00
Benjamin Peterson b3b0720597 merge 3.3 (#19115) 2013-09-28 15:13:10 -04:00
Benjamin Peterson 3103631f66 fix duplicate test names (closes #19115)
Patch by Xavier de Gaye.
2013-09-28 15:12:37 -04:00
Serhiy Storchaka 935349406a Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:57:00 +03:00
Serhiy Storchaka dafea85190 Issue #18873: The tokenize module, IDLE, 2to3, and the findnocoding.py script
now detect Python source code encoding only in comment lines.
2013-09-16 23:51:56 +03:00
Ezio Melotti e0c69161bc #18741: merge with 3.3. 2013-08-17 16:13:22 +03:00
Ezio Melotti b5bc353b88 #18741: fix more typos. Patch by Févry Thibault. 2013-08-17 16:11:40 +03:00
Andrew Svetlov ad28c7f9da Issue #16706: get rid of os.error 2012-12-18 22:02:39 +02:00
Benjamin Peterson 448e81b2da add fixer for reload() -> imp.reload() (closes #11797)\n\nPatch by Laurie Clark-Michalek and Berker Peksag 2012-12-07 22:44:10 -05:00
Benjamin Peterson 139891ba82 merge 3.2 (#16573) 2012-11-29 10:56:11 -05:00
Benjamin Peterson 57af38700a enumerate only requires an iterable (closes #16573)
Patch by Jonathan Kotta.
2012-11-29 10:55:22 -05:00