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
This signature tests do not properly check for cases where a function has more required positional arguments than it should. Such a case should be considered noncompliant, since user code written against the standard signature would not function. For example, if the standard has a function
deff(x, y=None):
...
then a function
deff(x, y):
...
should fail the signature test, because code like f(a) should work according to the standard but it wouldn't in the implementation.
The former works if you pass min and max as keywords but not if you pass them positionally (array-api-compat has a decorator that automatically injects the xp keyword argument into the final signature).
Additionally, some helpers to test optional positional arguments as both positional and keyword in the test itself would be useful. Right now we have specified_kwargs() but it doesn't allow passing the arguments as positional.
The text was updated successfully, but these errors were encountered:
This signature tests do not properly check for cases where a function has more required positional arguments than it should. Such a case should be considered noncompliant, since user code written against the standard signature would not function. For example, if the standard has a function
then a function
should fail the signature test, because code like
f(a)
should work according to the standard but it wouldn't in the implementation.Practically speaking, this would help me catch bugs with the
xp
signature logic in array-api-compat (see https://data-apis.org/array-api-compat/dev/implementation-notes.html). For instance, I accidentally wrotebut it should have been
The former works if you pass
min
andmax
as keywords but not if you pass them positionally (array-api-compat has a decorator that automatically injects thexp
keyword argument into the final signature).Additionally, some helpers to test optional positional arguments as both positional and keyword in the test itself would be useful. Right now we have
specified_kwargs()
but it doesn't allow passing the arguments as positional.The text was updated successfully, but these errors were encountered: