o SûbY ã@s2dZddlmZmZmZGdd„deƒZeƒZdS)z%Tools for working with read concerns.é)ÚAnyÚDictÚOptionalc@s„eZdZdZddeeddfdd„Zedeefdd„ƒZede fd d „ƒZ ede ee ffd d „ƒZ d e de fdd„Zdd„ZdS)Ú ReadConcerna ReadConcern :Parameters: - `level`: (string) The read concern level specifies the level of isolation for read operations. For example, a read operation using a read concern level of ``majority`` will only return data that has been written to a majority of nodes. If the level is left unspecified, the server default will be used. .. versionadded:: 3.2 NÚlevelÚreturncCs$|dus t|tƒr||_dStdƒ‚)Nzlevel must be a string or None.)Ú isinstanceÚstrÚ_ReadConcern__levelÚ TypeError)Úselfr©r ú;/tmp/pip-target-onvjaxws/lib/python/pymongo/read_concern.pyÚ__init__"s zReadConcern.__init__cCs|jS)zThe read concern level.)r ©r r r rr(szReadConcern.levelcCs|jdup |jdkS)z[Return ``True`` if this read concern is compatible with old wire protocol versions.NÚlocal©rrr r rÚ ok_for_legacy-szReadConcern.ok_for_legacycCsi}|jr |j|d<|S)zÖThe document representation of this read concern. .. note:: :class:`ReadConcern` is immutable. Mutating the value of :attr:`document` does not mutate this :class:`ReadConcern`. r)r r)r Údocr r rÚdocument3s zReadConcern.documentÚothercCst|tƒr |j|jkStS©N)rrrÚNotImplemented)r rr r rÚ__eq__@s  zReadConcern.__eq__cCs|jrd|jSdS)NzReadConcern(%s)z ReadConcern()rrr r rÚ__repr__Es zReadConcern.__repr__r)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr rÚpropertyrÚboolrrrrrrr r r rrs  rN)rÚtypingrrrÚobjectrZDEFAULT_READ_CONCERNr r r rÚs 7