_uuid (str or UUID)
See original GitHub issue- bleak version: develop
- Python version: N/A
- Operating System: N/A
Description
There are several places in the documentation where there is a _uuid
parameter. The docs say:
_uuid (str or UUID): The uuid of the characteristics to write to.
However, the type hints say: _uuid: str
.
Looking at the actual code, in some cases, uuid.UUID
is handled, but in others it is assumes that the parameter is a string, so when a pass a uuid.UUID
, things crash.
Which is correct, the doc string or the type hints?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
What is the performance hit of using a string type vs a uuid ...
UUID is a built in PostgreSQL type. It's basically a 128 bit integer. It should perform as an index just as well as...
Read more >uuid — UUID objects according to RFC 4122 ... - Python Docs
Comparison of UUID objects are made by way of comparing their UUID.int attributes. Comparison with a non-UUID object raises a TypeError . str(uuid)...
Read more >What is a UUID, and Why Should You Care? - Cockroach Labs
A UUID – that's short for Universally Unique IDentifier, by the way – is a 36-character alphanumeric string that can be used to...
Read more >Validate UUID String in Java | Baeldung
Learn how to validate a UUID string by using regular expressions or the static method of the UUID class.
Read more >uuid - Rust - Docs.rs
A UUID is a unique 128-bit value, stored as 16 octets, and regularly formatted as a hex string in five groups. UUIDs are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just adding 2 cents to the discussion. Support for both
uuid.UUID
andstr
seems to add a lot of complexity and will sometimes get confusing. Example when usingstart_notify()
withuuid.UUID
but the callback (aka response_handler) is called with the same uuid asstr
. Would be nice if it wasuuid.UUID
as it provides better sanity check and comparison is not case sensitive.It can be done like this, yes, but the problem is not handling the comparisons. Thanks for the effort, but this will not add enough value to be worthwhile imo.