Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pow function return type overly broad #285

Closed
@johnthagen

Description

@johnthagen

I happened to be reading through the typeshed code because of a completely unrelated issue I was tracking down, and noticed that the pow function return type seems to be overly broad:

https://github.com/python/typeshed/blob/master/stdlib/3/builtins.pyi#L703

def pow(x: int, y: int) -> Any: ...  # The return type can be int or float, depending on y

Should that be?

def pow(x: int, y: int) -> Union[int, float]: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions