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

Fix type hints for mypy 2.1 #1177

Merged
merged 1 commit into from
May 14, 2018
Merged

Fix type hints for mypy 2.1 #1177

merged 1 commit into from
May 14, 2018

Conversation

drvinceknight
Copy link
Member

@drvinceknight drvinceknight commented May 11, 2018

Closes #1176

Various things I've needed to do:

  • In a number of places include that the type is Optional[].
  • In a number of places include an assert so that mypy knows that
    the type is no longer None.
  • I have made a minor refactor to the Moran process, I could have used
    asserts but this actually pointed out a spot where I believe the tests
    were incorrect: we were testing a specific situation where
    MoranProcess.birth or MoranProcess.death should have been called with
    default index=None but was actually being tested with index=0.
  • I have ignored a type hint check in fingerprint.py: I was
    completely unable to get this one happy

To ensure that any new PRs don't break CI let's merge this under bug fix. 👍 :)

Closes #1176

Various things I've needed to do:

- In a number of places include that the type is `Optional[]`.
- In a number of places include an `assert` so that `mypy` knows that
  the type is no longer None.
- I have made a minor refactor to the Moran process, I could have used
  asserts but this actually pointed out a spot where I believe the tests
  were incorrect: we were testing a specific situation where
  `MoranProcess.birth` or `MoranProcess.death` should have been called with
  default `index=None` but was actually being tested with `index=0`.
- **I have ignored** a type hint check in `fingerprint.py`: I was
  completely unable to get this one happy

To ensure that any new PRs don't break CI let's merge this under bug fix.
@drvinceknight
Copy link
Member Author

Merging.

@drvinceknight drvinceknight merged commit 2bc5247 into master May 14, 2018
@marcharper marcharper deleted the fix-typing-for-mypy-2.1 branch August 17, 2018 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypy update has broken type hints
2 participants