Bas van Beek
Bas van Beek
Silencing the warnings via ``conftest.py`` also does the trick: https://github.com/eisensheng/pytest-catchlog/issues/59#issuecomment-601202470.
In general this seem like a perfect case for the use of a Protocol, so +1! Based on my experience in the typing of numpy I do have a couple...
> This is only true if `B` implements `__radd__`: Fair enough, I implicitly assumed that both `__add__` and `__radd__` would be defined. Nevertheless, my point here is that there is...
> Is there a problem with using `Tuple[int, ...]`? Right, to clarify: the reason for excluding subscription was for the sake of creating a compact example. > can you summarize...
Unfortunately you can't return `Literal` modules (which would make this _a lot_ easier), but when implementing the API it would be possible to define and return an auxiliary class that...
Small update: unfortunately https://github.com/python/mypy/issues/708 was never completelly fixed, so you'd have to return `type[_ArrayAPINameSpace]` in the case of mypy, otherwise it will interpret the namespace functions as normal methods and...
My personal thoughts: the standard currently specifies that [`__array_namespace__`](https://data-apis.org/array-api/latest/API_specification/array_object.html#array-namespace-self-api-version-none) should return "an object representing the array API namespace", so concrete API implementations should have enough flexibility to use this little...
Recently the `__getattr__` method to `types.ModuleType` in typeshed (xref https://github.com/python/typeshed/pull/6302), meaning that all module `getattr` operations lacking a dedicated set of annotations will return `Any`. Now, while this is by...
> That sounds like a good idea. `typeshed` isn't a common dependency though for libraries. Is it going to land in typing_extensions? So `typeshed` is the official repro containing annotations...
> Note that in the standard, the docs now say `**out**: _<object>_` and I'm not sure we can do better there (aside from a recommendation), because the returned object doesn't...