dsa-ou / allowed

Check if a program only uses a subset of the Python language.
https://dsa-ou.github.io/allowed/
BSD 3-Clause "New" or "Revised" License
10 stars 6 forks source link

Check 3rd slice parameter? #33

Closed mwermelinger closed 9 months ago

mwermelinger commented 10 months ago

allowed can be configured to allow the slice construct but doesn't distinguish between the 2-parameter and 3-parameter version. This means that [::-1] is allowed even though not taught in M269. Should we distinguish a slice2 and slice3 (or slice-step) construct in the JSON in the same way that a for-else has to be explicitly allowed? Is it worth the hassle?

mwermelinger commented 9 months ago

M269 decided to allow 3rd parameter and so it's not worth the hassle of checking the AST for it. This issue can be reopened when someone wants this feature.