MCPcopy
hub / github.com/python-attrs/attrs / validator

Method validator

src/attr/_make.py:2811–2823  ·  view source on GitHub ↗

Decorator that adds *meth* to the list of validators. Returns *meth* unchanged. .. versionadded:: 17.1.0

(self, meth)

Source from the content-addressed store, hash-verified

2809 self.alias = alias
2810
2811 def validator(self, meth):
2812 """
2813 Decorator that adds *meth* to the list of validators.
2814
2815 Returns *meth* unchanged.
2816
2817 .. versionadded:: 17.1.0
2818 """
2819 if self._validator is None:
2820 self._validator = meth
2821 else:
2822 self._validator = and_(self._validator, meth)
2823 return meth
2824
2825 def default(self, meth):
2826 """

Callers 2

__call__Method · 0.45
__call__Method · 0.45

Calls 1

and_Function · 0.85

Tested by

no test coverage detected