You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Michael reported that using an async with ... as clause in VSCode, the editor was not inferring the type of the CacheClient. That would be a pretty big deal for VSCode users.
We should try this in IDEA/PyCharm to narrow down the cause; if it works there then we can maybe rule out it being a library issue, and assume that it is something VSCode specific.
Either way, if we can't get it working in VSCode we may want to update our example code to account for this (e.g. don't use async with, just do a normal variable assignment and then an explicit close/exit? Or see if you can add a mypy type hint after the as clause?
The text was updated successfully, but these errors were encountered:
The root cause is import visibility rules used by pylance. See here #281 (comment).
This possibly explains the issue seen in IntelliJ with the match statements as well. To fix I will apply both redundant type aliases in __init__ files and also specify __all__. The __all__ specifications will allow users to type from momento.responses import *. Though this is discouraged by python, some users may expect it, and it also makes the names public.
Michael reported that using an
async with ... as
clause in VSCode, the editor was not inferring the type of the CacheClient. That would be a pretty big deal for VSCode users.We should try this in IDEA/PyCharm to narrow down the cause; if it works there then we can maybe rule out it being a library issue, and assume that it is something VSCode specific.
Either way, if we can't get it working in VSCode we may want to update our example code to account for this (e.g. don't use
async with
, just do a normal variable assignment and then an explicit close/exit? Or see if you can add a mypy type hint after theas
clause?The text was updated successfully, but these errors were encountered: