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
# 'Self', but at this point the verbose 'T...' syntax is needed.
Just thought to share that you can access this through from typing_extensions import Self. This will pass Mypy and LSP checks such as pylance in VSCode or others.
Thanks for the suggestion! Makes sense to me. Since typing_extensions is part of Python, I don't have any concerns about adding this dependency, and this seems to work with Pyre, which we use for type-checking, as well as with mypy.
This isn't going to be a high priority for the maintainers since we're just one minor version away from Python 3.11 and since this isn't broken now (just ugly) but I'd be happy to accept a pull request.
Heyo,
I was browsing through some code and found this comment:
botorch/botorch/models/model.py
Line 327 in 831072c
Just thought to share that you can access this through
from typing_extensions import Self
. This will passMypy
and LSP checks such as pylance in VSCode or others.This is already a transitive dependancy of yours through
torch
I did a quick check of other occurences and only found a similar usage in
botorch/models/approximate_gp.py
If relevant: the license for
typing_extensions
is the same as PythonsThe text was updated successfully, but these errors were encountered: