-
Notifications
You must be signed in to change notification settings - Fork 40
Update docs for 0.14 tag (#118) #119
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
Thanks! This looks great! 👍 🎉 |
The lint build failed but it failed on lines I didn't change. Is this a blocker? |
Mhm I re-ran the job - it still fails. Might be an newer linter / updates rules? |
I took a look but I'm not sure how to fix any of the errors. I'll paste here so we can discuss:
These two seem to be a configuration issue, like a bad
The error refers to these lines in the constructor:
I don't have any experience with type hints. Is that even valid way to type hint? It looks like a hint for a function but the field is a bool? I'm totally lost. |
Looks great, I'd be happy to merge as is, but I think you should remove the type information in the docstrings as #116 adds them in a way that can be verified. |
Regarding the linting issues, the wsproto/init.py line is removed in #116, it could also be removed here to pass the build. I'm not sure we need to run pylint on the examples and I'm confused why these appear now? |
Flesh out some missing pydocs, clean up the introduction, and make the examples more common wsproto idioms.
@Kriechi I just rebased this branch so it can merge into master. I noticed that master has some new type annotations and so the pydocs are redundant in some places with the type annotations. Here's an example from def send(self, event: Event) -> bytes:
"""
Generate network data for the specified event.
When you want to communicate with a WebSocket peer, you should construct
an event and pass it to this method. This method will return the bytes
that you should send to the peer.
:param wsproto.events.Event event: The event to generate data for
:returns bytes: The data to send to the peer
"""
data = b""
if self.connection is None:
data += self.handshake.send(event)
self.connection = self.handshake.connection
else:
data += self.connection.send(event)
return data The type of the It looks like there is a Sphinx plugin that might render type hints better, but I haven't ever used it before. It seems like a big enough change to warrant opening a separate issue. |
I don't mind the redundancy... at least for me, I'm still mostly looking at docstrings to figure out the expected types. Type hints have not been absorbed that deeply into my brain yet 😄 |
I think the sphinx plugin is worth using and including (I'm hoping it works). Without it I would worry that the docstrings and type hints naturally diverge and add confusion over time. |
Flesh out some missing pydocs, clean up the introduction, and make
the examples more common wsproto idioms.