The REQUIRES directive with multiple flags directive allows running of secondary parts
Erotemic opened this issue · comments
Jon Crall commented
The following example works incorrectly:
>>> # xdoc: +REQUIRES(--flag1)
>>> a = 1
>>> # xdoc: +REQUIRES(--flag2)
>>> b = a
If you give it only --flag2
it will correctly not run the flag1 part, but then it incorrectly runs the flag2 part (which should still be under the influence of the flag1 REQUIRES directive).
Jon Crall commented
More generally, it seems that current behavior only cares about the most recent directive. In the above example it doesn't matter how many false REQUIRES there are, as long as the last one is true it will still execute.