RecordFlux
RecordFlux copied to clipboard
Representation of null messages
Null messages are currently represented by an empty structure in AbstractMessage
. This leads to special handling in some cases. For example in graph
and pyrflx.typevalue
:
178 assert isinstance(self.__data, Message)
179
180 if not self.__data.structure:
181 self.__data.structure = [Link(INITIAL, FINAL)]
639 # structure is empty for NULL messages
640 if field == FINAL or not self._type.structure:
641 return None
Representing a null message by a structure of a single link from INITIAL to FINAL could make these special cases unnecessary.
Maybe I misremember that, but I think we had it like that in the past (or considered that option) and there was a reason to have the special handling. Getting rid of that would indeed be good!
Maybe I misremember that, but I think we had it like that in the past (or considered that option) and there was a reason to have the special handling. Getting rid of that would indeed be good!
Yes there was a specific reason to do it like this although I can't remember what it was.