optional=False,
_decoded=(0, 0, 0),
):
- if impl is None:
- self.tag = getattr(self, "impl", self.tag_default)
- else:
- self.tag = impl
+ self.tag = getattr(self, "impl", self.tag_default) if impl is None else impl
self._expl = getattr(self, "expl", None) if expl is None else expl
if self.tag != self.tag_default and self._expl is not None:
raise ValueError(
self._value = value
specs = getattr(self, "schema", {}) if _specs is None else _specs
self.specs = specs if isinstance(specs, dict) else dict(specs)
- if bounds is None:
- self._bound_min, self._bound_max = getattr(
- self,
- "bounds",
- (float("-inf"), float("+inf")),
- )
- else:
- self._bound_min, self._bound_max = bounds
+ self._bound_min, self._bound_max = getattr(
+ self,
+ "bounds",
+ (float("-inf"), float("+inf")),
+ ) if bounds is None else bounds
if value is not None:
self._value = self._value_sanitize(value)
if default is not None:
_decoded,
)
self._value = value
- if bounds is None:
- self._bound_min, self._bound_max = getattr(
- self,
- "bounds",
- (0, float("+inf")),
- )
- else:
- self._bound_min, self._bound_max = bounds
+ self._bound_min, self._bound_max = getattr(
+ self,
+ "bounds",
+ (0, float("+inf")),
+ ) if bounds is None else bounds
if value is not None:
self._value = self._value_sanitize(value)
if default is not None:
if schema is None:
raise ValueError("schema must be specified")
self.spec = schema
- if bounds is None:
- self._bound_min, self._bound_max = getattr(
- self,
- "bounds",
- (0, float("+inf")),
- )
- else:
- self._bound_min, self._bound_max = bounds
+ self._bound_min, self._bound_max = getattr(
+ self,
+ "bounds",
+ (0, float("+inf")),
+ ) if bounds is None else bounds
self._value = []
if value is not None:
self._value = self._value_sanitize(value)