question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
5frankcommented, Dec 30, 2019

Just adding 2 cents to the discussion. Support for both uuid.UUID and str seems to add a lot of complexity and will sometimes get confusing. Example when using start_notify() with uuid.UUID but the callback (aka response_handler) is called with the same uuid as str. Would be nice if it was uuid.UUID as it provides better sanity check and comparison is not case sensitive.

0reactions
hbldhcommented, Jan 18, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found