You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't see an exception listed in the docs, but the min() and max() translations are currently using the JS Math.min() and Math.max() which only support numbers, whereas the Python version also supports string types in the iterable.
// Maximum of n numbersexportfunctionmax(nrOrSeq){returnarguments.length==1 ? Math.max(...nrOrSeq) : Math.max(...arguments);};// Minimum of n numbersexportfunctionmin(nrOrSeq){returnarguments.length==1 ? Math.min(...nrOrSeq) : Math.min(...arguments);};
If used with an iterable containing strings, the translated max/min returns NaN. There are of course workarounds, but this should work the same as CPython or be a documented exception.
The text was updated successfully, but these errors were encountered:
I didn't see an exception listed in the docs, but the
min()
andmax()
translations are currently using the JSMath.min()
andMath.max()
which only support numbers, whereas the Python version also supports string types in the iterable.If used with an iterable containing strings, the translated max/min returns
NaN
. There are of course workarounds, but this should work the same as CPython or be a documented exception.The text was updated successfully, but these errors were encountered: