-
Notifications
You must be signed in to change notification settings - Fork 760
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
Added more specific type hints. Added send_text and send_bytes methods. #953
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #953 +/- ##
==========================================
- Coverage 83.56% 83.08% -0.49%
==========================================
Files 13 13
Lines 1381 1389 +8
Branches 258 260 +2
==========================================
Hits 1154 1154
- Misses 151 158 +7
- Partials 76 77 +1
☔ View full report in Codecov by Sentry. |
Thanks for the type hint upgrades. As for formatting the code, it's all a matter of taste. I'm happy with the way the code is currently unless you wish to elaborate on specific benefits black could bring in the context of this project. Otherwise it would be preferred to remove the newlines that were introduced by black in this PR. |
I have nothing against flake8, I just didn't know that's the style project adopted. I've noticed flake8 has built in formatter so I'll jus run that. Thanks for feedback. |
…s to the WebSocketApp and WebSocket classes. Formatted code.
I hope that the changes I've made are fine. The command I've used to format is If there is something else I should do please let me know. |
In my opinion, it'd be easier to maintain this project if a formatter was chosen. Any formatter with any style choice, whatever the authors find acceptable. It'd make the code look more consistent throughout the project, and it'd remove one burden from developers. |
I forgot that this PR wasn't merged yet. My comments:
|
I've added
py.typed
file so that type hints are properly used by linters.WebSocketApp
callback functions previously had more general type hints. They are now more specific.WebSocketApp
andWebSocket
classes now havesend_text
andsend_bytes
methods for convenience.I've used Black formatter to format the code in
_app.py
. If the authors of this project agree, we can format the entire codebase with some formatter (Black, YAPF, etc.) for more readable code.