Skip to content

time.sleep() type should reflect actually accepted parameters #15313

@Dutcho

Description

@Dutcho

In Python 3.14 and before, sleep() accepts:

  • actual float (or subtype),
  • or int-like, i.e. SupportsIndex.

From Python 3.15 (alpha 5), sleep() accepts:

  • float-like, i.e. SupportsFloat,
  • or int-like, i.e. SupportsIndex.

See discussion on different topic.

However, typeshed specifies float only:

def sleep(seconds: float, /) -> None: ...

I suggest to change that to actually accepted parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions