Mention that useful_id uses Zero as a 'blank' value

Place to report issues and suggest improvements to the API documentation.
User avatar
PennyJim
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Wed Jan 18, 2023 3:49 am
Contact:

Mention that useful_id uses Zero as a 'blank' value

Post by PennyJim »

I would like to add some minor clarification that the useful_id that register_on_object_destroyed and on_object_destroyed returns will use `0` instead of nil when there isn't an associated useful id to use.

It may already show that it's not nil-able, but I'm going to be honest in that I kind of overlooked that. Even if you do notice that, it helps to describe the behavior it has when it may otherwise be nil
asher_sky
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Oct 18, 2020 7:13 pm
Contact:

Re: Mention that useful_id uses Zero as a 'blank' value

Post by asher_sky »

+1
I read the phrase "Useful identifier of the object if it has one" and assumed it would be nil if the object didn't have one, completely overlooking the absence of a question mark next to the return. It would be nice to note that the value is specifically 0 if the object doesn't have a useful identifier
Post Reply

Return to “Documentation Improvement Requests”