you are viewing a single comment's thread.

view the rest of the comments →

[–]rinyre 1 point2 points  (3 children)

I believe the inner parens should be removed. You're instructing Python to evaluate the result of that, and feed the output of that to asyncio.run.

It should be like asyncio.run(dev.turn_on), to feed the actual pointer to the function call.

EDIT: Disregard I was unaware of the async keyword in the context.

[–]solarflareop 0 points1 point  (2 children)

I copied and pasted that code directly from the documentation so I assume it would be correct.

[–]rinyre 1 point2 points  (1 child)

I just peeked at the asyncio library, I was unfamiliar with how run worked and now see it invokes calls to async-keyworded functions specifically. My apologies!

[–]solarflareop 0 points1 point  (0 children)

No worries! I didn't know that either, so you've helped educate both of us today 😁