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: # This can be removed once we drop 3.8 and use attrs.Converter instead. from ._make import Converter
# Sentinel for disabling class-wide *on_setattr* hooks for certain attributes. # Sphinx's 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.