Skip to content

bool() return type on with no arguments #6069

@sobolevn

Description

@sobolevn

Right now bool has this __new__ signature: def __new__(cls: Type[_T], __o: object = ...) -> _T: ...

Should not it be:

@overload
def __new__(cls) -> Literal[False]: ...
@overload
def __new__(cls: Type[_T], __o: object) -> _T: ...

?

Current source:

def __new__(cls: Type[_T], __o: object = ...) -> _T: ...

What do you think?

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