Skip to content

asyncio stubs are missing Python 3.7 and 3.8 methods #2313

@hynek

Description

@hynek

I’ve tried to migrate a code base to 3.7 and noticed that the asyncio stubs need some love.

The ones I’ve noticed are:

  • asyncio.create_task()
  • asyncio.run()
  • asyncio.current_task()
  • asyncio.all_tasks()
  • asyncio.get_running_loop()
  • loop.start_tls()
  • loop.sock_sendfile()
  • loop.sendfile()
  • loop.sock_recv_into()
  • BufferedProtocol
  • StreamWriter.wait_closed()
  • Task.get_loop() (comment by @srittau: not in documentation or implementation)
  • Future.get_loop()
  • Server.get_loop()
  • start_serving argument for
    • loop.create_server(start_serving)
    • loop.create_unix_server(start_serving)
  • Server.start_serving()
  • Server.serve_forever()
  • Server.is_serving()
  • ssl_handshake_timeout argument for
    • asyncio.open_connection()
    • asyncio.start_server()
    • loop.create_connection()
    • loop.create_server()
    • loop.create_accepted_socket()
  • Handle.cancelled()
  • ReadTransport.is_reading()
  • “Loop methods which accept socket paths now support passing path-like objects. ” – that sounds like changes throughout the module?

But I suspect that everything new in 3.7 isn’t covered at all ATM.

Ref: https://docs.python.org/3/whatsnew/3.7.html#asyncio

Added by @srittau via the report by @Mulugruntz:

  • asyncio.BaseEventLoop
  • asyncio.WindowsProactorEventLoopPolicy
  • asyncio.windows_events

Added by @srittau via the report by @brianjyoung:

  • loop.create_task() now accepts a name
  • loop.create_connection() supports happy_eyeballs_delay and interleave
    New Task methods:
  • get_coro()
  • get_name()
  • set_name()

Metadata

Metadata

Assignees

No one assigned

    Labels

    stubs: incompleteAnnotations or sub-modules missing from an existing package or module

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions