Skip to content

Add overloads to operators that may not return the expected type #83

Description

@OutSquareCapital

Example: frozenset & AbstractSet is typed by typeshed to return a new frozenset when it fact it won't do this ->

frozenset.__and__(AbstractSet)

But ->
AbstractSet.__and__(frozenset)

Which in fact have zero guarantee of returning a new frozenset instance.

This is one example amongst many potential others.

I raised an issue on typeshed repo, need to monitor how they handle this first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    typingAnything related to type stubs, type checkers, typeshed, etc...

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions