#3337 Add typing overloads to Dataset.__getitem__ for mypy
CONTRIBUTOR
Locally the `make quality` passes with the same dependencies. I would suggest upgrading flake8. (I can take care of it in another PR)
cc @lhoestq 
2021-12-06T17:04:17Z
https://github.com/huggingface/datasets/pull/3382#issuecomment-986970306
https://api.github.com/repos/huggingface/datasets/issues/3382
IC_kwDODunzps460_jC
https://api.github.com/repos/huggingface/datasets/issues/comments/986970306/reactions
2021-12-06T17:13:41Z
https://api.github.com/repos/huggingface/datasets/issues/comments/986970306
https://avatars.githubusercontent.com/u/8976546?v=4
https://api.github.com/users/Dref360/events{/privacy}
https://api.github.com/users/Dref360/followers
https://api.github.com/users/Dref360/following{/other_user}
https://api.github.com/users/Dref360/gists{/gist_id}
https://github.com/Dref360
Dref360
MDQ6VXNlcjg5NzY1NDY=
https://api.github.com/users/Dref360/orgs
https://api.github.com/users/Dref360/received_events
https://api.github.com/users/Dref360/repos
https://api.github.com/users/Dref360/starred{/owner}{/repo}
https://api.github.com/users/Dref360/subscriptions
User
https://api.github.com/users/Dref360
public
CONTRIBUTOR
Thank you for fixing flake8! I think we are ready to merge then. 
2021-12-14T03:20:16Z
https://github.com/huggingface/datasets/pull/3382#issuecomment-993119793
https://api.github.com/repos/huggingface/datasets/issues/3382
IC_kwDODunzps47Mc4x
https://api.github.com/repos/huggingface/datasets/issues/comments/993119793/reactions
2021-12-14T03:20:16Z
https://api.github.com/repos/huggingface/datasets/issues/comments/993119793
https://avatars.githubusercontent.com/u/8976546?v=4
https://api.github.com/users/Dref360/events{/privacy}
https://api.github.com/users/Dref360/followers
https://api.github.com/users/Dref360/following{/other_user}
https://api.github.com/users/Dref360/gists{/gist_id}
https://github.com/Dref360
Dref360
MDQ6VXNlcjg5NzY1NDY=
https://api.github.com/users/Dref360/orgs
https://api.github.com/users/Dref360/received_events
https://api.github.com/users/Dref360/repos
https://api.github.com/users/Dref360/starred{/owner}{/repo}
https://api.github.com/users/Dref360/subscriptions
User
https://api.github.com/users/Dref360
public
Add typing overloads to Dataset.__getitem__ for mypy

Fixes #3337 

**Iterable**
Iterable from `collections` cannot have a type, so you can't do `Iterable[int]` for example. `typing` has a Generic version that builds upon the one from `collections`.

**Flake8**
I had to add `# noqa: F811`, this is a bug from Flake8.

datasets uses flake8==3.7.9 which released in October 2019 if I update flake8 (4.0.1), I no longer get these errors, but I did not want to make the update without your approval. (It also triggers other errors like no args in f-strings.)