Open knutnergaard opened 4 weeks ago
iirc, None
is there for reasons (@typemytype or @typesupply can shed light), so it should clarify that it can return either. Thank you!
Right, if the identifier hasn't been defined None
is returned. If it has been defined, it is passed through the normalizer. We do this because if this property created an identifier if one isn't defined, all objects in all UFOs would have identifiers after their next save. That would do bad things to version control and file sizes.
To sum, docs should be clear that _get_identifer
may return str
or None
base.IdentifierMixin.identifier
is a read-only attribute which returnsstr
orNone
. The docs for the_get_identifier
method states that an identifier should be assigned to any object that does not have one. IOW, it should always returnstr
. This does not, however, seem to comply with the base getter:Given that the attribute is a mandatory override, should the documentation clarify that the
_get_identifier
return may be eitherstr
orNone
or am I missing something with regard to the logic here?