Type Hints for aioredis #584
Type Hints for aioredis #584
Conversation
+ enabling type hints using `mypy` + added initial type checks for `errors.py` and `parser.py`
- &MYPY | ||
name: mypy | ||
cache: false | ||
python: "3.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python: "3.6" | |
python: "3.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense. Added 3.7 version for Travis-CI job.
aioredis/parser.py
Outdated
self.pos: int = 0 | ||
self.protocolError: Callable = protocolError | ||
self.replyError: Callable = replyError | ||
self.encoding: Optional[str] = encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wont work in Python 3.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean variable annotations
Ensuring that typings will be recognized by python 3.5
Codecov Report
@@ Coverage Diff @@
## master #584 +/- ##
===========================================
- Coverage 96.82% 80.34% -16.49%
===========================================
Files 57 57
Lines 8411 7976 -435
Branches 563 561 -2
===========================================
- Hits 8144 6408 -1736
- Misses 191 1513 +1322
+ Partials 76 55 -21
Continue to review full report at Codecov.
|
What do these changes do?
mypy
errors.py
andparser.py
Are there changes in behavior for the user?
None
Related issue number
#555
Checklist
CONTRIBUTORS.txt
<Name> <Surname>
.CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.