-
Notifications
You must be signed in to change notification settings - Fork 17
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
Improve Python API #122
Improve Python API #122
Conversation
@fcollonval I believe commit b7ab80a addresses your concerns in #65. See jupyterlab/jupyter-collaboration#72 for an example of the change required in the callback. |
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.
It seems to be a good improvement indeed. You probably need to update the signature of YBaseDoc.observe
too.
Yes, thanks. |
ed0e943
to
d1380be
Compare
d1380be
to
a75ea4e
Compare
Commit a75ea4e partially addresses #123 by adding |
jupyter_ydoc/ydoc.py
Outdated
@@ -153,9 +155,9 @@ def unobserve(self) -> None: | |||
self._subscriptions = {} | |||
|
|||
|
|||
class YFile(YBaseDoc): | |||
class YUTF8(YBaseDoc): |
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.
Should we use something more generic like YText?
the idea is a bit like for YBytes to let the door open to other encoding. And also it is probably more easy to grasp.
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.
Should we use something more generic like YText?
Maybe, although YText
already exists in y-py, but you're right, if they don't call it YUTF8
there then I guess there is no reason that we do it here.
the idea is a bit like for YBytes to let the door open to other encoding. And also it is probably more easy to grasp.
Actually I'd like to rename YBytes
to YBlob
, which reflects the idea that it's a whole chunk of data on which we cannot collaborate on an element basis. Also, it can store anything, not only bytes.
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.
04a7f74 renames YBytes
to YBlob
. Actually, it really stores bytes, which is fine since blob stands for "binary large object".
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.
Thanks for pointing the existing YText
in y-py. So maybe YText
here is not the most appropriate as it can generate confusion. I'm a bit short of idea - I thought about YStr
or YString
but i'm half convinced.
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.
Traitlets has Unicode. It's similar to the previous YUTF8
, but maybe more inline with the rest of the Jupyter ecosystem?
for more information, see https://pre-commit.ci
04a7f74
to
9abd30b
Compare
Closes #65.