File: faq.rst

package info (click to toggle)
python-cerberus 1.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,532 kB
  • sloc: python: 5,239; makefile: 130
file content (18 lines) | stat: -rw-r--r-- 840 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Frequently Asked Questions
==========================

Can I use Cerberus to validate objects?
---------------------------------------

Yes. See `Validating user objects with Cerberus <https://nicolaiarocci.com/validating-user-objects-cerberus/>`_.

Are Cerberus validators thread-safe, can they be used in different threads?
---------------------------------------------------------------------------

The normalization and validation methods of validators make a copy of the
provided document and store it as :attr:`~cerberus.Validator.document`
property. Because of this it is advised to create a new
:class:`~cerberus.Validator` instance for each processed document when used in
a multi-threaded context. Alternatively you can use a
:class:`py3:threading.Lock` to confirm that only one document processing is
running at any given time.