-
Notifications
You must be signed in to change notification settings - Fork 827
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
[Feature] Pyright strict mode compatibility #1532
Comments
I'll raise with the team to better understand None v. NoneType choice here. |
I've researched this as much as I can and came to the below conclusions, which I'm spelling out here on the off chance that it's helpful for your team. I also created PR #1536 in an effort to make this fix as low effort as possible.
>>> def foo() -> None: ...
>>> str(typing.get_type_hints(foo)["return"])
"<class 'NoneType'>" And this line in However, it's definitely not correct to actually use The mypy docs have this to say:
|
Hi! I'm trying to use playwright with my codebase, which uses pyright in strict mode. I'm finding that assertions in the sync API make pyright unhappy, because
NoneType
turns into Unknown:If I replace all the
NoneType
annotations inplaywright/sync_api/_generated.py
withNone
, the error goes away.(I just want to add, this is the only problem I've run into with playwright so far--in every other respect it's been a pleasure to use!)
The text was updated successfully, but these errors were encountered: