_config.py 514 B

1234567891011121314151617181920212223
  1. from __future__ import absolute_import, division, print_function
  2. __all__ = ["set_run_validators", "get_run_validators"]
  3. _run_validators = True
  4. def set_run_validators(run):
  5. """
  6. Set whether or not validators are run. By default, they are run.
  7. """
  8. if not isinstance(run, bool):
  9. raise TypeError("'run' must be bool.")
  10. global _run_validators
  11. _run_validators = run
  12. def get_run_validators():
  13. """
  14. Return whether or not validators are run.
  15. """
  16. return _run_validators