pschanely / CrossHair

An analysis tool for Python that blurs the line between testing and type systems.
Other
1.03k stars 49 forks source link

Do not attempt to short-circuit calls with concrete arguments #190

Open pschanely opened 2 years ago

pschanely commented 2 years ago

Noted by @petrusboniatus in https://github.com/pschanely/CrossHair/discussions/187#discussioncomment-4209603_

One thing that came as a shock to me is that without precomputing the hash outside the function it does not end ...

If you make many calls (in this case ~30) to short-circuit-able functions like hash(), is likely that at least one of them will short-circuit. But we want at least some number of executions to avoid them all (and probably some to use them all). But in this case, it's especially sad because all the arguments are concrete. At the very least, we should never short-circuit when given concrete arguments.