Open eddiebergman opened 2 weeks ago
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.
PR submitted #2494
Heyo,
I was browsing through some code and found this comment: https://github.com/pytorch/botorch/blob/831072cacb1351adf4ac7cf0c5326a7437cbe2b5/botorch/models/model.py#L327
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 Pythons