Skip to content

Suggest to use a protocol instead of a module #13861

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

Conversation

sobolevn
Copy link
Member

@AlexWaygood do you have any suggestions about the error message?

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

apprise (https://github.com/caronc/apprise)
+ apprise/config/ConfigBase.pyi:3: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:6: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:12: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:21: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:29: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:35: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:38: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:43: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:44: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:45: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseConfig.pyi:47: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseAttachment.pyi:6: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseAttachment.pyi:27: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseAttachment.pyi:33: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/AppriseAttachment.pyi:34: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/Apprise.pyi:17: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/Apprise.pyi:24: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/Apprise.pyi:31: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/Apprise.pyi:43: note: Perhaps you meant to use a protocol matching the module structure?
+ apprise/Apprise.pyi:53: note: Perhaps you meant to use a protocol matching the module structure?

@sobolevn
Copy link
Member Author

Diff is correct, there's a module in apprise's Union: https://github.com/caronc/apprise/blob/master/apprise/AppriseConfig.pyi#L6

@hauntsaninja
Copy link
Collaborator

Thanks!

@hauntsaninja hauntsaninja merged commit 68ab69c into python:master Oct 11, 2022
@AlexWaygood
Copy link
Member

^The error message looks pretty good to me! The only way I can really see to improve it while keeping it reasonably short would be to maybe link to some docs describing the problem in more detail. But I'm not sure whether it's worth that.

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