Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

def has_array_namespace(obj) -> TypeIs[HasNamespace] #19

Open
Labels
✨ featureIntroduce new features.
@jorenham

Description

(削除) I'm not sure if has_namespace is the best name for this typeguard, so (削除ここまで) Suggestions are welcome.

Example implementation that builds #17:

# _namespace.py
from typing_extensions import TypeIs
# --snip--
def has_namespace(obj: object, /) -> TypeIs[HasNamespace[Any]]:
 return hasattr(obj, "__array_namespace__")

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ featureIntroduce new features.

    Type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /