File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1022,15 +1022,15 @@ def _missing__While(self, node: ast.While) -> ast.AST | None:
1022
1022
new_while .orelse = []
1023
1023
return new_while
1024
1024
1025
- def is_constant_expr (self , node : ast .AST ) -> str | None :
1025
+ def is_constant_expr (self , node : ast .AST ) -> bool :
1026
1026
"""Is this a compile-time constant?"""
1027
1027
node_name = node .__class__ .__name__
1028
1028
if node_name in ["Constant" , "NameConstant" , "Num" ]:
1029
- return "Num"
1029
+ return True
1030
1030
elif isinstance (node , ast .Name ):
1031
1031
if node .id in ["True" , "False" , "None" , "__debug__" ]:
1032
- return "Name"
1033
- return None
1032
+ return True
1033
+ return False
1034
1034
1035
1035
# In the fullness of time, these might be good tests to write:
1036
1036
# while EXPR:
You can’t perform that action at this time.
0 commit comments