Skip to content
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

Add deserializing from str #8

Open
cybercyst opened this issue Feb 22, 2021 · 0 comments
Open

Add deserializing from str #8

cybercyst opened this issue Feb 22, 2021 · 0 comments

Comments

@cybercyst
Copy link

When serializing something, it is useful to be able to deserialize it back into a useful object... ksuid doesn't seem to allow this currently

I'd expect something like the following to work

def test_ksuid_deserializable():
    from ksuid import ksuid
    id = ksuid()

    serialized_id = str(id)

    id2 = ksuid(serialized_id)

    # not the same object in memory
    assert id is not id2
    # but they serialize to the same value
    assert str(id) == str(id2)
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

No branches or pull requests

1 participant