There's no need to check the type of the parameter because
field.value = value
will raise a type error if `value` has an unexpected type.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I0ae91873024e9a52a00bb1ac6f03ff830a19dea7
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1570
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
self._owner_put_ref)
def __setitem__(self, index, value):
- # we can only set numbers and strings
- if not isinstance(value, (numbers.Number, _StringField, str)):
- raise TypeError('expecting number or string object')
-
# raises if index is somehow invalid
field = self[index]