Skip to content

Conversation

crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Jan 17, 2025

Change is_lazy_array and is_writeable_array to return False when the argument is not an array API object at all.
This puts them in line with all other is_*_array functions and is coherent with isinstance semantics.

Clarify in the documentation that all is_*_array objects accept any object as parameter.

Out of scope: annotate with TypeIs, which is very much non-trivial.

return __name__.removesuffix('.common._helpers')


def is_numpy_namespace(xp) -> bool:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sphinx gave me grief over ModuleType, so I left it out of scope for this PR.

@ev-br ev-br merged commit 44e1eb3 into data-apis:main Jan 17, 2025
42 checks passed
@ev-br
Copy link
Member

ev-br commented Jan 17, 2025

LGTM, thanks @crusaderky

@crusaderky crusaderky deleted the is_array_object branch January 20, 2025 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants