The behaviour of many functions when sending None as one of the named arguments is many times under defined. There are cases that there are discrepancies between implementation.
Eg
The built-in function sorted has two named parameters, these are key and reverse. Both Bazel and Starlark-Go only accept bool values for reverse, producing the errors
Error in sorted: in call to sorted(), parameter 'reverse' got value of type 'NoneType', want 'bool'
and
sorted: for parameter "reverse": got NoneType, want bool
The same is not the case for the named parameter key. Bazel accepts key = None and behaves as if this were not present (ie the identity function), while Starlark-Go produces the error
sorted: for parameter "key": got NoneType, want callable
Should there be a convention defined in the spec on what is the behaviour when explicitly sending None as one of the named parameters?
The behaviour of many functions when sending
Noneas one of the named arguments is many times under defined. There are cases that there are discrepancies between implementation.Eg
The built-in function
sortedhas two named parameters, these arekeyandreverse. Both Bazel and Starlark-Go only accept bool values forreverse, producing the errorsand
The same is not the case for the named parameter
key. Bazel acceptskey = Noneand behaves as if this were not present (ie the identity function), while Starlark-Go produces the errorShould there be a convention defined in the spec on what is the behaviour when explicitly sending
Noneas one of the named parameters?