Replies: 10 comments
|
False (do not allow) and 0 (allow 0 times) are equivalent. I'm against -1 as a special value for inifinity, because it's lesser than 0 and it is not intuitive what it means. "allow=True" on the other hand is intuitive. It is allowed, full stop, do not trip on it no matter how high. "allow=False" is also intuitive: crash immediately no matter how small the infraction. allow_dask_compute=True is actually a second iteration of this design. The first iteration was allow_dask_compute=999, which a lot of people found confusing, so I added the option for bool. I'm against changing this. "bool | int" being a redundant alias for "int" is a design flaw of python typing which has already been extensively discussed elsewhere, and IMHO not worth arguing about here. |
|
While I agree with the sentiment that a single type would be nicer than a (fake in this case...) union type, I'm still pretty happy with the current state, and don't feel that this is worth making a change. |
|
I'll just note that IMO this is the case where each individual step might make sense and is intuitive, but the final result does not and is not intuitive. |
|
I suggest:
I think any lack of clarity goes away if the variable name matches the meaning of the values rather than suggesting a boolean when the values are counts. |
thanks Albert, that looks nice to me! |
I'm happy with this. |
do you fit the criteria @ev-br :) ? |
|
@lucascolley. Following the decision in scipy/scipy#24205, my impression is that this has become moot for SciPy developers until Dask support is re-prioritized. |
|
going to transfer this to a discussion, makes sense to keep it discoverable in case Dask support is re-prioritised I suppose |
Uh oh!
There was an error while loading. Please reload this page.
lazy_xp_function' accepts itsallow_dask_computeargument as either bool or int whereTrueis equivalent to a very large integer:This is very much unexpected. First of all,
bool | inttyping is equivalent to justint. So I'd expect that eitherFalseis converted to zero, or an int gets converted to a boolean viabool(allow_dask_compute).Since the "number of times" is non-negative, I'd very much expect to express "any number of times" as -1 or just negative.
All reactions