in uamqp/message.py [0:0]
def user_id(self, value):
if isinstance(value, str):
value = value.encode(self._encoding)
elif value is not None and not isinstance(value, bytes):
raise TypeError("user_id must be bytes or str.")
# user_id is type of binary according to the spec.
# convert byte string into bytearray then wrap the data into c_uamqp.BinaryValue.
if value is not None:
self._user_id = utils.data_factory(
bytearray(value), encoding=self._encoding
)
else:
self._user_id = None