valkey-py: new type hints i wrote seem to be wrong

hi so in the past few commits i have deleted Awaitable from the type hints the argumnet was that async methods don’t return awaitable which is right

but valkey-py methods aren’t async, they are sync methods that could return an awaitable

async def f()  -> int:
    return 2
    
def a() -> Awaitable:
    return f

so having Awaitable in the return types, while annoying, are correct this problem was pointed out by fix error in python’s discord

there is also the suggestion to have different methods for sync and async, or go fully sync but that’s not for me to decide

the question i have is, how would go about reverting the changes?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks everyone for your input!

We discussed this internally and decided to do the following:

  1. @amirreza8002 I will revert your typing PRs now and close this ticket
  2. I will publish a new beta since it contains the fix for Python 3.13 and we need that
  3. I will create a new ticket to revisit the typing system within the repository. There’s a chance it will take quite a lot of time and effort so I can’t promise it to have very high priority

Yep it’s wrong, and fails when you type check it