@@ -220,7 +220,7 @@ def first_lines(self, lines):
220220 Returns a set of the first lines.
221221
222222 """
223- return set ( self .first_line (l ) for l in lines )
223+ return { self .first_line (l ) for l in lines }
224224
225225 def translate_lines (self , lines ):
226226 """Implement `FileReporter.translate_lines`."""
@@ -520,7 +520,7 @@ class AstArcAnalyzer(object):
520520 def __init__ (self , text , statements , multiline ):
521521 self .root_node = ast .parse (neuter_encoding_declaration (text ))
522522 # TODO: I think this is happening in too many places.
523- self .statements = set ( multiline .get (l , l ) for l in statements )
523+ self .statements = { multiline .get (l , l ) for l in statements }
524524 self .multiline = multiline
525525
526526 if AST_DUMP : # pragma: debugging
@@ -626,10 +626,10 @@ def _line__Module(self, node):
626626 return 1
627627
628628 # The node types that just flow to the next node with no complications.
629- OK_TO_DEFAULT = set ([
629+ OK_TO_DEFAULT = {
630630 "Assign" , "Assert" , "AugAssign" , "Delete" , "Exec" , "Expr" , "Global" ,
631631 "Import" , "ImportFrom" , "Nonlocal" , "Pass" , "Print" ,
632- ])
632+ }
633633
634634 @contract (returns = 'ArcStarts' )
635635 def add_arcs (self , node ):
@@ -661,7 +661,7 @@ def add_arcs(self, node):
661661 print ("*** Unhandled: {}" .format (node ))
662662
663663 # Default for simple statements: one exit from this node.
664- return set ([ ArcStart (self .line_for_node (node ))])
664+ return { ArcStart (self .line_for_node (node ))}
665665
666666 @one_of ("from_start, prev_starts" )
667667 @contract (returns = 'ArcStarts' )
@@ -677,7 +677,7 @@ def add_body_arcs(self, body, from_start=None, prev_starts=None):
677677
678678 """
679679 if prev_starts is None :
680- prev_starts = set ([ from_start ])
680+ prev_starts = { from_start }
681681 for body_node in body :
682682 lineno = self .line_for_node (body_node )
683683 first_line = self .multiline .get (lineno , lineno )
@@ -890,7 +890,7 @@ def _handle_decorated(self, node):
890890 self .add_arc (last , lineno )
891891 last = lineno
892892 # The body is handled in collect_arcs.
893- return set ([ ArcStart (last )])
893+ return { ArcStart (last )}
894894
895895 _handle__ClassDef = _handle_decorated
896896
@@ -984,7 +984,7 @@ def _handle__Try(self, node):
984984 # If there are `except` clauses, then raises in the try body
985985 # will already jump to them. Start this set over for raises in
986986 # `except` and `else`.
987- try_block .raise_from = set ([] )
987+ try_block .raise_from = set ()
988988 else :
989989 self .block_stack .pop ()
990990
@@ -1079,7 +1079,7 @@ def _combine_finally_starts(self, starts, exits):
10791079 if start .cause is not None :
10801080 causes .append (start .cause .format (lineno = start .lineno ))
10811081 cause = " or " .join (causes )
1082- exits = set ( ArcStart (xit .lineno , cause ) for xit in exits )
1082+ exits = { ArcStart (xit .lineno , cause ) for xit in exits }
10831083 return exits
10841084
10851085 @contract (returns = 'ArcStarts' )
0 commit comments