uuid-utils icon indicating copy to clipboard operation
uuid-utils copied to clipboard

typing doesn't match impl

Open trim21 opened this issue 1 year ago • 7 comments

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 avatar Sep 09 '24 15:09 trim21

also kwargs is_safe doesn't exist

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

trim21 avatar Sep 09 '24 15:09 trim21

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

trim21 avatar Sep 09 '24 15:09 trim21

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

aminalaee avatar Sep 09 '24 16:09 aminalaee

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.

trim21 avatar Sep 09 '24 16:09 trim21

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

aminalaee avatar Sep 09 '24 17:09 aminalaee

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

trim21 avatar Sep 15 '24 01:09 trim21

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

trim21 avatar Sep 15 '24 03:09 trim21