Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release 5.0.0 returns error with pyright #2897

Open
sylvainmouquet opened this issue Aug 17, 2023 · 1 comment
Open

New release 5.0.0 returns error with pyright #2897

sylvainmouquet opened this issue Aug 17, 2023 · 1 comment

Comments

@sylvainmouquet
Copy link

Hello,

pyright returns a error with the new version :

Version: 5.0.0

Platform: MacOs amd64

Description:

for l in redis.xread({"events": "0"}, count=100000, block=0):

« Awaitable[Unknown] » n’est pas itérable
  Méthode « __iter__ » non définie
@einarwar
Copy link

I'm having the same issues using pyright==1.1.323.
xread() method is typed as returning ResponseT which is a type-alias for Union[Awaitable, Any]. From pyright's point of view this kinda makes sense, as an Awaitable and Any is indeed quite different.

Does it exist any suggested way of telling the type-checker whether we are using sync or async Redis to avoid this, or is this a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants