@@ -74,7 +74,7 @@ def visit_Module(self, node):
7474 if (isinstance (body [i ], GlobalDecl ) or isinstance (body [i ], NonLocalDecl )):
7575 raise ParseError (
7676 "Expected function, class, or variable declaration" , node .body [i ])
77- if decl == False :
77+ if not decl :
7878 raise ParseError (
7979 "All declarations must come before statements" , node .body [i ])
8080 declarations .append (b )
@@ -105,7 +105,7 @@ def visit_FunctionDef(self, node):
105105 if isinstance (b , ClassDef ):
106106 raise ParseError (
107107 "Inner classes are unsupported" , node .body [i ])
108- if decl == False :
108+ if not decl :
109109 raise ParseError (
110110 "All declarations must come before statements" , node .body [i ])
111111 declarations .append (b )
@@ -143,7 +143,7 @@ def visit_ClassDef(self, node):
143143 node .decorator_list [0 ])
144144 body = [self .visit (b ) for b in node .body ]
145145 # allow class bodies that only contain a single pass
146- if len (body ) == 1 and body [0 ] == None :
146+ if len (body ) == 1 and body [0 ] is None :
147147 body = []
148148 else :
149149 for i in range (len (body )):
@@ -156,7 +156,7 @@ def visit_ClassDef(self, node):
156156
157157 def visit_Return (self , node ):
158158 location = self .getLocation (node )
159- if node .value == None :
159+ if node .value is None :
160160 return ReturnStmt (location , None )
161161 else :
162162 return ReturnStmt (location , self .visit (node .value ))
@@ -288,7 +288,7 @@ def visit_Constant(self, node):
288288 return BooleanLiteral (location , node .value )
289289 elif isinstance (node .value , int ):
290290 return IntegerLiteral (location , node .value )
291- elif isinstance (node .value , str ) and node .kind == None :
291+ elif isinstance (node .value , str ) and node .kind is None :
292292 return StringLiteral (location , node .value )
293293 elif node .value is None :
294294 return NoneLiteral (location )
@@ -335,7 +335,7 @@ def visit_List(self, node):
335335
336336 def visit_NameConstant (self , node ):
337337 location = self .getLocation (node )
338- if node .value == None :
338+ if node .value is None :
339339 return NoneLiteral (location )
340340 elif isinstance (node .value , bool ):
341341 return BooleanLiteral (location , node .value )
0 commit comments