feature: improve channel typings, add method stubs#2022
Open
devkral wants to merge 3 commits intodjango:mainfrom
Open
feature: improve channel typings, add method stubs#2022devkral wants to merge 3 commits intodjango:mainfrom
devkral wants to merge 3 commits intodjango:mainfrom
Conversation
Contributor
Author
|
ping? |
Member
Yes, I'm not sure about this. It's a lot of noise for not much benefit as far as I can see. Surely though, if we were adding types, a Protocol would be the way forward, rather than base class stub methods... 🤔 |
Contributor
Author
|
The problem my PR solves is, that it is not obvious for programmers how to write a layer backend.
|
This comment was marked as outdated.
This comment was marked as outdated.
330b5a2 to
39835c2
Compare
Contributor
Author
|
how do you think about this? BaseChannelLayer is now abstract, the extensions are now runtime checkable Protocols. If you think this is good, I can document the changes |
06ab017 to
b5bb16b
Compare
b5bb16b to
e4bd0cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the layers module is untyped and BaseChannelLayer is not a real interface (lacks stub methods)
This PR adds typings and stub methods (for type hinting and getting a meaningful error in case something is missing)