Viewing File: /opt/alt/python38/lib/python3.8/site-packages/cerberus/__pycache__/utils.cpython-38.pyc

U

!`#@sddlmZddlmZddlmZmZmZmZm	Z	eddZ
ddZdd	Zd
dZ
dd
ZddZddZGdddeZdifddZdS))absolute_import)
namedtuple)
_int_types	_str_typeMappingSequenceSetTypeDefinitionz"name,included_types,excluded_typescCstt|t|}|d||d|kr6t||kSt|D]h}||||}}tttfD]&}t||r^t||r|qq^dSq^||krq>q>||krdSdSq>tdS)NTF)minlenrangerrtuple
isinstanceRuntimeError)xyZ
min_lengthiabZ_typer?/opt/alt/python38/lib/python3.8/site-packages/cerberus/utils.pycompare_paths_lts 


rcCs|d|||ddS)Nr)trrrrdrop_item_from_tuple.srcCsdtkrddlmatS)N	Validatorr)r)globalsZcerberus.validatorrrrrrget_Validator_class2s
rcCstt|SN)hashmapping_to_frozenset)Zschemarrrmapping_hash9sr!cCsi}|D]\}}t|tr,t|||<qt|trtt|}t|D]\}}t|trFt|||<qFt|||<qt|trt	|||<q|||<qt	|S)z
    Be aware that this treats any sequence type with the equal members as equal. As it
    is used to identify equality of schemas, this can be considered okay as definitions
    are semantically equal regardless the container type.
    )
itemsrrr rlist	enumerater
r	frozenset)mappingZaggregationkeyvalueritemrrrr =s




r cCst|trd|S|SdS)Nz"%s")rr)r(rrrquote_stringWs
r*cs,eZdZfddZddZddZZS)readonly_classpropertycstt||Sr)superr+__get__)selfinstanceowner	__class__rrr-_szreadonly_classproperty.__get__cCstddSNz"This is a readonly class property.r)r.r/r(rrr__set__bszreadonly_classproperty.__set__cCstddSr3r4)r.r/rrr
__delete__esz!readonly_classproperty.__delete__)__name__
__module____qualname__r-r5r6
__classcell__rrr1rr+^sr+NcCsvt}|dkr|f}nt|tr,||f7}n||f}dd|D}t|dkrjd|krj|dd|it|||S)a
    Dynamically create a :class:`~cerberus.Validator` subclass.
    Docstrings of mixin-classes will be added to the resulting class' one if ``__doc__``
    is not in :obj:`namespace`.

    :param name: The name of the new class.
    :type name: :class:`str`
    :param bases: Class(es) with additional and overriding attributes.
    :type bases: :class:`tuple` of or a single :term:`class`
    :param namespace: Attributes for the new class.
    :type namespace: :class:`dict`
    :return: The created class.
    NcSsg|]}|jr|jqSr)__doc__).0rrrr
<listcomp>sz%validator_factory.<locals>.<listcomp>rr;
)rrr
rupdatejointype)namebases	namespacerZ
docstringsrrrvalidator_factoryis
rE)Z
__future__rcollectionsrZcerberus.platformrrrrrr	rrrr!r r*propertyr+rErrrr<module>s

Back to Directory File Manager