-
Notifications
You must be signed in to change notification settings - Fork 234
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
add typing to aiokafka/protocol/* #999
Merged
Merged
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e4b20ab
add typing to aiokafka/protocol/*
dimastbk 1708b46
fix review
dimastbk 5a7e3dd
fix VarInt64
dimastbk 68c2e7c
fix review tuple -> list
dimastbk 66980a6
fix review
dimastbk 6006aa6
fix review
dimastbk ded596c
move ALL_TOPICS/NO_TOPICS to docs
dimastbk 25311ef
remove default values from Message()
dimastbk 593bd4d
fix checking abstractproperty in test
dimastbk 86059a3
fix review
dimastbk 09a7575
fix review (from docstrings to comments)
dimastbk bd4a520
fix: collections.abc.Sequence -> typing.Sequence
dimastbk 0f8863c
fix review: Message
dimastbk 339ca06
add FIXME
dimastbk 675cb96
fix review: Message
dimastbk afe0439
use NotImplemented instead of False
dimastbk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import abc | ||
from io import BytesIO | ||
from typing import Generic, TypeVar | ||
|
||
T = TypeVar("T") | ||
|
||
class AbstractType(metaclass=abc.ABCMeta): | ||
|
||
class AbstractType(Generic[T], metaclass=abc.ABCMeta): | ||
@classmethod | ||
@abc.abstractmethod | ||
def encode(cls, value): ... | ||
def encode(cls, value: T) -> bytes: ... | ||
|
||
@classmethod | ||
@abc.abstractmethod | ||
def decode(cls, data): ... | ||
def decode(cls, data: BytesIO) -> T: ... | ||
Check notice Code scanning / CodeQL Statement has no effect Note
This statement has no effect.
|
||
|
||
@classmethod | ||
def repr(cls, value): | ||
def repr(cls, value: T) -> str: | ||
return repr(value) |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
Check notice
Code scanning / CodeQL
Statement has no effect Note