diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-13 19:51:17 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-13 19:51:17 (GMT) |
| commit | 050ca6530d876b70ac60dca274280fe0911494dd (patch) | |
| tree | cb8612e27230a132a437c1f89c20948d6c2f5ff1 /Lib/lib2to3/fixer_util.py | |
| parent | e0f4bc7608f9ac63a3f67f0f08afc49128f4fb14 (diff) | |
| parent | db9b65d9e5d9d39199714cfd15a26e46ab0eaae1 (diff) | |
| download | cpython-050ca6530d876b70ac60dca274280fe0911494dd.zip cpython-050ca6530d876b70ac60dca274280fe0911494dd.tar.gz cpython-050ca6530d876b70ac60dca274280fe0911494dd.tar.bz2 | |
Issue #22823: Use set literals in lib2to3.
Diffstat (limited to 'Lib/lib2to3/fixer_util.py')
| -rw-r--r-- | Lib/lib2to3/fixer_util.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib2to3/fixer_util.py b/Lib/lib2to3/fixer_util.py index 6e259c5..44502bf 100644 --- a/Lib/lib2to3/fixer_util.py +++ b/Lib/lib2to3/fixer_util.py @@ -187,8 +187,8 @@ def parenthesize(node): return Node(syms.atom, [LParen(), node, RParen()]) -consuming_calls = set(["sorted", "list", "set", "any", "all", "tuple", "sum", - "min", "max", "enumerate"]) +consuming_calls = {"sorted", "list", "set", "any", "all", "tuple", "sum", + "min", "max", "enumerate"} def attr_chain(obj, attr): """Follow an attribute chain. @@ -359,7 +359,7 @@ def touch_import(package, name, node): root.insert_child(insert_pos, Node(syms.simple_stmt, children)) -_def_syms = set([syms.classdef, syms.funcdef]) +_def_syms = {syms.classdef, syms.funcdef} def find_binding(name, node, package=None): """ Returns the node which binds variable name, otherwise None. If optional argument package is supplied, only imports will @@ -402,7 +402,7 @@ def find_binding(name, node, package=None): return ret return None -_block_syms = set([syms.funcdef, syms.classdef, syms.trailer]) +_block_syms = {syms.funcdef, syms.classdef, syms.trailer} def _find(name, node): nodes = [node] while nodes: |
