def validate(instance, attrib, new_value): """
Run *attrib*'s validator on *new_value* if it has one.
.. versionadded:: 20.1.0 """ if _config._run_validators isFalse: return new_value
v = attrib.validator ifnot v: return new_value
v(instance, attrib, new_value)
return new_value
def convert(instance, attrib, new_value): """
Run *attrib*'s converter -- if it has one -- on *new_value* and return the
result.
.. versionadded:: 20.1.0 """
c = attrib.converter if c: return c(new_value)
return new_value
# Sentinel for disabling class-wide *on_setattr* hooks for certain attributes. # autodata stopped working, so the docstring is inlined in the API docs.
NO_OP = object()
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.