8000 Fix several type annotations for mypy 0.4.6 compatibility. by rwbarton · Pull Request #2545 · zulip/zulip · GitHub
[go: up one dir, main page]

Skip to content

Fix several type annotations for mypy 0.4.6 compatibility. #2545

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

Closed
wants to merge 1 commit into from

Conversation

rwbarton
Copy link
Contributor
@rwbarton rwbarton commented Dec 3, 2016

A few functions had arguments removed without having their type
annotations updated accordingly. As a result mypy version 0.4.6
thinks that the first type in the annotation is supposed to be
the type of self, a new mypy feature which we are not intending
to use here.

A few functions had arguments removed without having their type
annotations updated accordingly. As a result mypy version 0.4.6
thinks that the first type in the annotation is supposed to be
the type of `self`, a new mypy feature which we are not intending
to use here.
@smarx
Copy link
smarx commented Dec 3, 2016

Automated message from Dropbox CLA bot

@rwbarton, it looks like you've already signed the Dropbox CLA. Thanks!

@timabbott
Copy link
Member

You can also just add a commit upgrading our mypy in requirements/mypy.txt.

@rwbarton
Copy link
Contributor Author
rwbarton commented Dec 3, 2016

There's another issue with tools/deprecated/iframe-bot/show-last-messages, but I don't understand why it was supposedly passing before.

@rwbarton
Copy link
Contributor Author
rwbarton commented Dec 3, 2016

Okay, I provisioned and ran mypy from inside the VM and that file does pass with mypy 0.4.5, so I can investigate what's going on here.

@timabbott
Copy link
Member

I think that's actually a mypy caching bug; try moving aside var/mypy-cache...

@timabbott
Copy link
Member

Merged, thanks @rwbarton!

@timabbott timabbott closed this Dec 3, 2016
@rwbarton
Copy link
Contributor Author
rwbarton commented Dec 3, 2016

Okay here is the situation. There is a type error in tools/deprecated/iframe-bot/show-last-messages, but this bug python/mypy#2523 in mypy 0.4.5 masks it. However, that bug was fixed in 0.4.6, so new mypy correctly reports an error. But the type error is due to incomplete stubs for codecs (python/typeshed#732), so I can't just fix it.

Should I fix it with a cast and then bump the mypy version? Or just leave this as is for now.

@timabbott
Copy link
Member

What we usually do when working around this sort of issue is add type: ignore to deal with this sort of situation, with a link to the mypy/typeshed bug ID that caused us to have to add it, so it's easy to clean things up later when the bug is fixed.

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
0