Skip to content
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

Update and fix typing #378

Merged
merged 1 commit into from Jan 26, 2020
Merged

Conversation

ilai-deutel
Copy link
Contributor

This PR updates the type stubs for new methods (buckets.__iter__, numeric_range.*) and fixes type hints for sample and grouper.

@bbayles
Copy link
Collaborator

bbayles commented Jan 26, 2020

Thanks!

@bbayles bbayles merged commit 04f8a12 into more-itertools:master Jan 26, 2020
obj: object,
base_type: Union[
type, Tuple[Union[type, Tuple[Any, ...]], ...], None
] = ...,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilai-deutel
Since a lot of this seems to just about wrapping for line-length I've wanted to mention that it is typically OK for .pyi files to have long lines, and a special flake8 config can be used to handle that (#376).
Also (larger) style changes are better off in a separate commit then also.
(just for info / my 2 cents)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used black to format the .pyi with the same parameters as I used when I initially created the .pyi files, which are the ones used for the .py files (black -S -l 79 as in #306). typeshed uses a line length of 130 for stub files and it was suggested to become the default in psf/black#341, but the project maintainer decided otherwise.
79 characters for regular Python files and 130 for stub files sounds reasonable to me, what do you think @bbayles? Also, if black is enforced across the project, there could be black checks in the travis config in addition to flake8.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of re-formatting everything with black, and enforcing it in Travis. I'll do that for a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants