Yeah, I don't like all those magic values either; that's indeed ugly... :-(
But I don't really want to introduce constants for each such values either: given each variable may have its own special value to define it is unavailable, that would make for a lot of contants, which would not be much better...
The ETSI.si2etsi() prototype is:
class ETSI:
def si2etsi(
value: float | None,
scale: float,
undef: Optional[int] = None,
validity_range: Optional[dict] = None,
out_of_range: Optional[int] = None,
) -> int:
In retrospect, I see two issues there:
- the
undef parameter should have been named unavailable (or undefined)
- the parameters should have been keyword-only, so when called, it would be obvious that the value being passed as
undefined (or unavailable) was exactly that: undefined (or unavailable).
So, I would like to address this in a followup change, if that's OK for you?
Originally posted by @ymorin-orange in #459 (comment)
Yeah, I don't like all those magic values either; that's indeed ugly... :-(
But I don't really want to introduce constants for each such values either: given each variable may have its own special value to define it is unavailable, that would make for a lot of contants, which would not be much better...
The
ETSI.si2etsi()prototype is:In retrospect, I see two issues there:
undefparameter should have been namedunavailable(orundefined)undefined(orunavailable) was exactly that: undefined (or unavailable).So, I would like to address this in a followup change, if that's OK for you?
Originally posted by @ymorin-orange in #459 (comment)