Page MenuHomeSoftware Heritage
Paste P613

(An Untitled Masterwork)
ActivePublic

Authored by douardda on Mar 12 2020, 3:33 PM.
def attrib_typecheck(default: Any = attr.NOTHING,
type: Optional[Type] = None,
validator: Collection[Callable] = ()):
"A 'partial' of attr.ib that prefill the validator with type_validator"
return attr.attrib(
default=default,
type=type,
validator=[type_validator(), *validator])