Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Doubt inspinner_async.py example #37

Open
@CarMoreno

Description

@CarMoreno

Hi Luciano,

I am playing a bit with thespinner_async.py example, and I am wondering why the execution finishes normally when I comment thespinner.cancel() line in thesupervisor function. I think the execution should stay in an infinite loop because I am not cancelling the coroutine and, therefore theasyncio.CancelledError exception is never raised.

asyncdefsupervisor()->int:# <3>spinner=asyncio.create_task(spin('thinking!'))# <4>print(f'spinner object:{spinner}')# <5>result=awaitslow()# <6>#spinner.cancel()  # <------This is the only change <7>returnresult

I am forgetting something?, any comments to help me to understand this scenario are welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp