Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/attr/_config.py
7763 views
1
# SPDX-License-Identifier: MIT
2
3
from __future__ import absolute_import, division, print_function
4
5
6
__all__ = ["set_run_validators", "get_run_validators"]
7
8
_run_validators = True
9
10
11
def set_run_validators(run):
12
"""
13
Set whether or not validators are run. By default, they are run.
14
15
.. deprecated:: 21.3.0 It will not be removed, but it also will not be
16
moved to new ``attrs`` namespace. Use `attrs.validators.set_disabled()`
17
instead.
18
"""
19
if not isinstance(run, bool):
20
raise TypeError("'run' must be bool.")
21
global _run_validators
22
_run_validators = run
23
24
25
def get_run_validators():
26
"""
27
Return whether or not validators are run.
28
29
.. deprecated:: 21.3.0 It will not be removed, but it also will not be
30
moved to new ``attrs`` namespace. Use `attrs.validators.get_disabled()`
31
instead.
32
"""
33
return _run_validators
34
35