-
Notifications
You must be signed in to change notification settings - Fork 16
Add ready: bool
annotation to YRoom
#126
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
@@ -83,7 +83,7 @@ def __init__( | |||
""" | |||
self.ydoc = Doc() if ydoc is None else ydoc | |||
self.ready_event = Event() | |||
self.ready = ready | |||
self.ready: bool = ready |
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.
Maybe really add the annotation at the class level above, as your comment says?
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.
That change caused a mypy
error in the CI, likely because we already have a @property
defined for it. You can check the details here
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.
The property and setter are already properly annotated as returning/taking bool
, so I’m not sure why mypy is still complaining about this. To work around this, I think it’s simplest to add a class-level annotation and silence the redefinition error with a # type: ignore
.
Isn't the CI failure in jupyterlab/jupyter-collaboration#480 expected, since it updates |
Ahh, I was missing that—thanks for the clarification! I'll go ahead and close this PR since it's not needed. |
Adds a ready: bool class‐level annotation to YRoom so mypy recognizes self.ready and the [has-type] error goes away.
CI error: https://github.com/jupyterlab/jupyter-collaboration/actions/runs/14774032452/job/41478969976?pr=480