Skip to content

export encode_any decode_any - using the lib0 any-encode format - #413

Open
dmonad wants to merge 1 commit into
mainfrom
any-encoding
Open

dmonad wants to merge 1 commit into
mainfrom
any-encoding

Conversation

@dmonad

@dmonad dmonad commented Aug 6, 2026

Copy link
Copy Markdown

Hey @davidbrochart,

I'm currently working on a project that requires reading lib0-encoded content from python. Could we export encode_any / decode_any from pycrdt? I'd appreciate a review and if you could make a new release once you are done.

Thanks!

@dmonad
dmonad requested a review from davidbrochart August 6, 2026 14:20
Comment thread python/pycrdt/_sync.py

from ._any import encode_any
from ._doc import Doc
from ._pycrdt import decode_any as _decode_any

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not the following?

Suggested change
from ._pycrdt import decode_any as _decode_any
from ._any import decode_any

Comment thread src/type_conversions.rs
}
// An `int` that doesn't fit in 64 bits has no `Any` representation; callers that need to
// report that precisely use `py_to_any_strict`, everyone else treats it as unsupported.
py_to_int_any(value).unwrap_or(Any::Undefined)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a breaking change?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants