aminalaee / uuid-utils

Python bindings to Rust UUID
https://aminalaee.dev/uuid-utils
BSD 3-Clause "New" or "Revised" License
115 stars 9 forks source link

typing doesn't match impl #69

Open trim21 opened 1 week ago

trim21 commented 1 week ago
import uuid_utils
from uuid_utils import uuid7

print(uuid_utils.__version__) # 0.9.0

u = uuid7()

print(u, u.is_safe)

https://github.com/aminalaee/uuid-utils/blob/926d2c26154126d31dcb7f9956b4f2400422be56/python/uuid_utils/__init__.pyi#L85-L86

    print(u, u.is_safe)
             ^^^^^^^^^
AttributeError: 'uuid_utils.UUID' object has no attribute 'is_safe'
trim21 commented 1 week ago

also kwargs is_safe doesn't exist

https://github.com/aminalaee/uuid-utils/blob/926d2c26154126d31dcb7f9956b4f2400422be56/python/uuid_utils/__init__.pyi#L83

trim21 commented 1 week ago

also SafeUUID doesn't exists in uuid_utils/__init__.py, but exists in uuid_utils/__init__.pyi

aminalaee commented 1 week ago

Yes the whole safe UUID idea doesn't exist. Feel free to implement it.

trim21 commented 1 week ago

I know nothing about uuid-rs, is generator safe to be called in a multiprocessing?

I think we should remove these typings, and add them back when someone implement it.

aminalaee commented 1 week ago

Adding them can't be hard. I will get to it for the next version.

trim21 commented 3 days ago

looks like it's difficult to import some python variable and use it in pyo3...

trim21 commented 3 days ago

https://github.com/aminalaee/uuid-utils/pull/70