We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent15d2fe8 commiteb4e18fCopy full SHA for eb4e18f
py/compile.c
@@ -713,6 +713,23 @@ STATIC void c_if_cond(compiler_t *comp, mp_parse_node_t pn, bool jump_if, int la
713
}elseif (MP_PARSE_NODE_STRUCT_KIND(pns)==PN_not_test_2) {
714
c_if_cond(comp,pns->nodes[0], !jump_if,label);
715
return;
716
+ }elseif (MP_PARSE_NODE_STRUCT_KIND(pns)==PN_atom_paren) {
717
+// cond is something in parenthesis
718
+if (MP_PARSE_NODE_IS_NULL(pns->nodes[0])) {
719
+// empty tuple, acts as false for the condition
720
+if (jump_if== false) {
721
+EMIT_ARG(jump,label);
722
+ }
723
+ }elseif (MP_PARSE_NODE_IS_STRUCT_KIND(pns->nodes[0],PN_testlist_comp)) {
724
+// non-empty tuple, acts as true for the condition
725
+if (jump_if== true) {
726
727
728
+ }else {
729
+// parenthesis around 1 item, is just that item
730
+c_if_cond(comp,pns->nodes[0],jump_if,label);
731
732
+return;
733
}
734
735