Support for recursive datatypes
since release of mypy 0.981 recursive types are supported; i have just removed the # as per suggestion in the TODO comment and have changed the mypy version in the ci jobs.
This PR is to check if ci is breaking with the changes are not. fixes #640
Let me know if any further changes need to be made thanks..
Hmm, mypy is raising one error on this line
returning TypeVar should receive at least one argument containing the same
Typevar [type-var]
Found 1 error in 1 file (checked 76 source files)
def draw(self) -> T:
https://github.com/pytorch/data/blob/b1b3406389fa6665ec3422ae5e1ebf65ae7e2938/torchdata/datapipes/iter/util/randomsplitter.py#L103-L105
How can i fix this? can anyone help me out here?
Based on this issue, it seems to be warning that a single TypeVar will not do anything. I think you can either remove -> T or suppress the warning.
@NivekT has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
hello @ejguan! Thanks for the feedback.
Make TorchData fully out of PyTorch
Honestly, I do not know the consequences and the amount of work required for this but the second option seems easier than the first.
Anyway, there is no hurry from my side; I just noticed the TODO issue and was aware of the recent mypy version release.
We could try updating the pytorch's mypy version. Are there any existing blockers in doing this that you are aware of?
Would love to hear your thoughts. Thanks!
BTW, regarding the recursive type hints, 0.981 is not the best version as it's an experimental feature. 0.990 is the version that officially supports recursive type hints.
Let's wait until PyTorch has officially updated mypy
BTW, regarding the recursive type hints, 0.981 is not the best version as it's an experimental feature. 0.990 is the version that officially supports recursive type hints.
I was just going to mention this.