diff -r 917fd18a4ba4 Lib/lib2to3/fixer_util.py --- a/Lib/lib2to3/fixer_util.py Thu Dec 11 10:30:42 2014 +0200 +++ b/Lib/lib2to3/fixer_util.py Thu Dec 11 10:32:56 2014 +0200 @@ -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=Non 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: diff -r 917fd18a4ba4 Lib/lib2to3/fixes/fix_dict.py --- a/Lib/lib2to3/fixes/fix_dict.py Thu Dec 11 10:30:42 2014 +0200 +++ b/Lib/lib2to3/fixes/fix_dict.py Thu Dec 11 10:32:56 2014 +0200 @@ -36,7 +36,7 @@ from ..fixer_util import Name, Call, LPa from .. import fixer_util -iter_exempt = fixer_util.consuming_calls | set(["iter"]) +iter_exempt = fixer_util.consuming_calls | {"iter"} class FixDict(fixer_base.BaseFix): diff -r 917fd18a4ba4 Lib/lib2to3/patcomp.py --- a/Lib/lib2to3/patcomp.py Thu Dec 11 10:30:42 2014 +0200 +++ b/Lib/lib2to3/patcomp.py Thu Dec 11 10:32:56 2014 +0200 @@ -32,7 +32,7 @@ class PatternSyntaxError(Exception): def tokenize_wrapper(input): """Tokenizes a string suppressing significant whitespace.""" - skip = set((token.NEWLINE, token.INDENT, token.DEDENT)) + skip = {token.NEWLINE, token.INDENT, token.DEDENT} tokens = tokenize.generate_tokens(io.StringIO(input).readline) for quintuple in tokens: type, value, start, end, line_text = quintuple diff -r 917fd18a4ba4 Lib/lib2to3/refactor.py --- a/Lib/lib2to3/refactor.py Thu Dec 11 10:30:42 2014 +0200 +++ b/Lib/lib2to3/refactor.py Thu Dec 11 10:32:56 2014 +0200 @@ -57,7 +57,7 @@ def _get_head_types(pat): # Always return leafs if pat.type is None: raise _EveryNode - return set([pat.type]) + return {pat.type} if isinstance(pat, pytree.NegatedPattern): if pat.content: @@ -133,7 +133,7 @@ def _detect_future_features(source): def advance(): tok = next(gen) return tok[0], tok[1] - ignore = frozenset((token.NEWLINE, tokenize.NL, token.COMMENT)) + ignore = frozenset({token.NEWLINE, tokenize.NL, token.COMMENT}) features = set() try: while True: