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

Remove -> None annotation from __init__ #472

Merged
merged 2 commits into from
Jan 2, 2019
Merged

Remove -> None annotation from __init__ #472

merged 2 commits into from
Jan 2, 2019

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Jan 1, 2019

Last month, mypy adopted a change that makes the -> None return annotation for otherwise-annotated __init__() signatures unnecessary.

This PR implements that change in our codebase, since I think it's much cleaner (__init__ is ALWAYS -> None).

However, this is a stylistic question so I put it up for debate.

Here's the documentation:
https://mypy.readthedocs.io/en/latest/class_basics.html#annotating-init-methods

And here's the 4 years of discussion:
python/mypy#604

@jlowin jlowin requested review from cicdw and joshmeek as code owners January 1, 2019 02:35
@jlowin jlowin force-pushed the init-annotation branch 2 times, most recently from f6ad931 to 9d20b58 Compare January 1, 2019 02:39
@cicdw
Copy link
Member

cicdw commented Jan 2, 2019

Question that I just can't ignore: given that no other PRs were being merged, why were 3 force pushes necessary for this?

Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

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

I'm cool with this

@jlowin
Copy link
Member Author

jlowin commented Jan 2, 2019

It was my obsession with making this a single commit. A couple of weird mypy breakages that had to be fixed multiple times, so each time I squashed and force-pushed.

@jlowin jlowin merged commit c5b5547 into master Jan 2, 2019
@jlowin jlowin deleted the init-annotation branch January 2, 2019 14:59
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.

3 participants