Issue #22823: Use set literals in lib2to3.

This commit is contained in:
Serhiy Storchaka 2014-12-13 21:50:49 +02:00
parent bd62f0a6e4
commit db9b65d9e5
4 changed files with 8 additions and 8 deletions

View file

@ -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: