File tree 1 file changed +13
-13
lines changed 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -1117,19 +1117,6 @@ Node().is_empty() # True
1117
1117
Node (" x = 1" ).find_variable (" x" ).is_empty () # False
1118
1118
` ` `
1119
1119
1120
- #### ` get_nth_statement ()`
1121
-
1122
- ` ` ` python
1123
- stmts = " " "
1124
- if True:
1125
- pass
1126
-
1127
- x = 1
1128
- " " "
1129
-
1130
- Node (stmts).get_nth_statement (1 ).is_equivalent (" x = 1" ) # True
1131
- ` ` `
1132
-
1133
1120
#### ` value_is_call ()`
1134
1121
1135
1122
This allows you to check if the return value of a function call is assigned to a variable.
@@ -1184,6 +1171,19 @@ explorer.is_ordered("x=0", "x=1") # False
1184
1171
explorer .find_ifs ()[0 ].is_ordered (" print(x)" , " print('x is:')" ) # False
1185
1172
` ` `
1186
1173
1174
+ #### How to get the nth statement
1175
+
1176
+ ` ` ` python
1177
+ stmts = " " "
1178
+ if True:
1179
+ pass
1180
+
1181
+ x = 1
1182
+ " " "
1183
+
1184
+ Node (stmts)[1 ].is_equivalent (" x = 1" ) # True
1185
+ ` ` `
1186
+
1187
1187
## Notes on Python
1188
1188
1189
1189
- Python does **not** allow newline characters between keywords and their arguments. E.g:
You can’t perform that action at this time.
0 commit comments