
    f"u                        d Z dZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	l	m
Z
 dd
l	mZ ddl	mZ ddl	mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddlm"Z" dd lm#Z# dd!l$m%Z% dd"l&m'Z' dd#l&m(Z( dd$l&m)Z) dd%l&m*Z* dd&l&m+Z+ dd'l&m,Z, dd(l&m-Z- dd)l&m.Z. dd*l&m/Z/ dd+l&m0Z0 dd,l&m1Z1 dd-l&m2Z2 dd.l&m3Z3 dd/l&m4Z4 dd0l&m5Z5 dd1l&m6Z6 dd2l&m7Z7 dd3l&m8Z8 dd4l&m9Z9 dd5l&m:Z: dd6l&m;Z; dd7l&m<Z< dd8l&m=Z= dd9l&m>Z> dd:l&m?Z? dd;l&m@Z@ dd<l&mAZA dd=l&mBZB dd>l&mCZC dd?l&mDZD dd@l&mEZE ddAl&mFZF ddBl&mGZG ddCl&mHZH ddDl&mIZI ddEl&mJZJ ddFl&mKZK ddGl&mLZL ddHl&mMZM ddIl&mNZN ddJl&mOZO ddKl&mPZP ddLl&mQZQ ddMl&mRZR ddNl&mSZS ddOl&mTZT ddPl&mUZU ddQl&mVZV ddRl&mWZW ddSl&mXZX ddTl&mYZY ddUl&mZZZ ddVl&m[Z[ ddWl&m\Z\ ddXl&m]Z] ddYl&m^Z^ ddZl&m_Z_ dd[l&m`Z` dd\l&maZa dd]lbmcZc dd^lbmdZd  e%e9d_         e_e         e%e9d`         e_f         e%e9da         e_g         e%e9db         e_h         e
ee9        e%eEdc         e_i         e%eEdd         e_j         ee!eX        ee"eY        eeeP        eee,        eeeB        eee2        eeeJ        eee1        ee eS        eeeR        eee@        eee?        eee6        eeeO        G de dfek      Zl eeW       G dg dhe!             Zm ee-e<e;       G di djee             Zn eleHe<e;       G dk dle!             Zo ee'       G dm dneo             Zp ee.       G do dpen             Zq eleIe<e;       G dq dre"             Zr ee*       G ds dtep             Zs G du dvete_      Zu ee:       G dw dxe              Zv ee5       G dy dzee             Zw ee4       G d{ d|ee             Zx ee[       G d} d~ee             Zy eeZ       G d dee             Zz G d de_ete{      Z| G d de_ete}      Z~ ee/e<       G d de             Z G d der      ZdZedz  Z ej                  e      j                  Z ee(       G d de             ZdZ ej                  dez   dz         j                  Z ej                  dez   dz   ez   dz   dz         j                  Z eeQ       G d de             Z ee8       G d de             Z ee>       G d de             Z eeA       G d de             ZddZd Z ee0       G d dee             ZeZ eeT       G d de             Z ee\       G d de             Z eeG       G d de             Z eeC       G d de             Z G d de      Z eeU       G d de             Z ee=       G d de             Z eeD       G d dee             Z eeF       G d de             Z ee7       G d de             Zy)zSchema Fields
restructuredtext    N)abc)date)datetime)time)	timedelta)classImplements)classImplementsFirst)implementedBy)implementer)
IInterface)Bool)Complex)	Container)Decimal)Field)Int)Integral)InvalidDecimalLiteral)Iterable)	MinMaxLen)Number)Object)	Orderable)Password)Rational)Real)Text)TextLine)	_NotGiven)FieldProperty)IASCII)IURI)ConstraintNotSatisfied)
IASCIILine)IBaseVocabulary)IBool)IBytes)
IBytesLine)IChoice)ICollection)IComplex)
IContainer)IContextSourceBinder)IDate)	IDatetime)IDecimal)IDict)IDottedName)IField)IFloat)
IFromBytes)IFromUnicode)
IFrozenSet)IId)IInt)	IIntegral)IInterfaceField)	IIterable)IList)IMapping)
IMinMaxLen)IMutableMapping)IMutableSequence)INativeString)INativeStringLine)INumber)InvalidDottedName)	InvalidId)
InvalidURI)InvalidValue)IObject)	IPassword)IPythonIdentifier)	IRational)IReal)	ISequence)ISet)ISource)ISourceText)IText)	ITextLine)ITime)
ITimedelta)ITuple)NotAnInterface)	NotUnique)ValidationError)WrongContainedType)	WrongType)SimpleVocabulary)getVocabularyRegistrytitledescriptionrequiredreadonly
min_length
max_lengthc                       e Zd Zd Zd Zy)implementer_if_neededc                     || _         y N)_ifaces)selfifacess     j/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/zope/schema/_field.py__init__zimplementer_if_needed.__init__   s	        c                     g }t        |      }| j                  D cg c]  }|j                  |      s| }} t        | |      S c c}w rh   )r   ri   isOrExtendsr   )rj   clsifaces_neededimplementedifaces        rl   __call__zimplementer_if_needed.__call__   s[    #C( 
**51 
 

 +{M*3//
s   AN)__name__
__module____qualname__rm   ru    rn   rl   rf   rf      s    0rn   rf   c                   (    e Zd Zej                  ZeZy)
SourceTextN)rv   rw   rx   rR   __doc__str_typery   rn   rl   r{   r{      s    !!GErn   r{   c                   4    e Zd Zej                  ZeZd Zd Zy)Bytesc                 B    | j                  |j                  d            S ) See IFromUnicode.
        ascii)	fromBytesencoderj   values     rl   fromUnicodezBytes.fromUnicode   s     ~~ell7344rn   c                 (    | j                  |       |S rh   validater   s     rl   r   zBytes.fromBytes   s    ern   N)	rv   rw   rx   r(   r|   bytesr~   r   r   ry   rn   rl   r   r      s    nnGE5
rn   r   c                       e Zd ZdZeZd Zy)NativeStringa  
    A native string is always the type `str`.

    In addition to :class:`~zope.schema.interfaces.INativeString`,
    this implements :class:`~zope.schema.interfaces.IFromUnicode` and
    :class:`~zope.schema.interfaces.IFromBytes`.

    .. versionchanged:: 4.9.0
       This is now a distinct type instead of an alias for either `Text` or
       `Bytes`, depending on the platform.
    c                 J    |j                  d      }| j                  |       |S Nzutf-8decoder   r   s     rl   r   zNativeString.fromBytes   !    W%ern   Nrv   rw   rx   r|   r}   r~   r   ry   rn   rl   r   r      s    
 Ern   r   c                   6     e Zd Zej                  Z fdZ xZS )ASCIIc                     t         t        |   |       |sy t        t	        t
        |            dk  st               j                  | |      y )N   )superr   	_validatemaxmapordrI   with_field_and_valuerj   r   	__class__s     rl   r   zASCII._validate   sE    eT$U+3sE?#c).55dEBB *rn   )rv   rw   rx   r"   r|   r   __classcell__r   s   @rl   r   r      s    nnGC Crn   r   c                       e Zd ZdZd Zy)	BytesLinez!A `Bytes` field with no newlines.c                 
    d|vS )N   
ry   r   s     rl   
constraintzBytesLine.constraint   s    E!!rn   N)rv   rw   rx   r|   r   ry   rn   rl   r   r      s
    +"rn   r   c                       e Zd ZdZeZd Zy)NativeStringLinea  
    A native string is always the type `str`; this field excludes
    newlines.

    In addition to :class:`~zope.schema.interfaces.INativeStringLine`,
    this implements :class:`~zope.schema.interfaces.IFromUnicode` and
    :class:`~zope.schema.interfaces.IFromBytes`.

    .. versionchanged:: 4.9.0
       This is now a distinct type instead of an alias for either `TextLine`
       or `BytesLine`, depending on the platform.
    c                 J    |j                  d      }| j                  |       |S r   r   r   s     rl   r   zNativeStringLine.fromBytes   r   rn   Nr   ry   rn   rl   r   r      s     Ern   r   c                   *    e Zd Zej                  Zd Zy)	ASCIILinec                 
    d|vS )N
ry   r   s     rl   r   zASCIILine.constraint   s    5  rn   N)rv   rw   rx   r%   r|   r   ry   rn   rl   r   r      s      G!rn   r   c                       e Zd ZdZy)InvalidFloatLiteralzRaised by Float fields.Nrv   rw   rx   r|   ry   rn   rl   r   r     s    !rn   r   c                       e Zd ZdZeZefZeZy)Floata6  
    A field representing a native :class:`float` and implementing
    :class:`zope.schema.interfaces.IFloat`.

    The class :class:`zope.schema.Real` is a more general version,
    accepting floats, integers, and fractions.

    The :meth:`fromUnicode` method only accepts values that can be parsed
    by the ``float`` constructor::

        >>> from zope.schema._field import Float
        >>> f = Float()
        >>> f.fromUnicode("1")
        1.0
        >>> f.fromUnicode("125.6")
        125.6
        >>> f.fromUnicode("1+0j") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: Invalid literal for float(): 1+0j
        >>> f.fromUnicode("1/2") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: invalid literal for float(): 1/2
        >>> f.fromUnicode(str(2**11234) + '.' + str(2**256))
        ... # doctest: +ELLIPSIS
        inf
        >>> f.fromUnicode("not a number") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: could not convert string to float: not a number

    Likewise for :meth:`fromBytes`::

        >>> from zope.schema._field import Float
        >>> f = Float()
        >>> f.fromBytes(b"1")
        1.0
        >>> f.fromBytes(b"125.6")
        125.6
        >>> f.fromBytes(b"1+0j") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: Invalid literal for float(): 1+0j
        >>> f.fromBytes(b"1/2") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: invalid literal for float(): 1/2
        >>> f.fromBytes((str(2**11234) + '.' + str(2**256)).encode('ascii'))
        ... # doctest: +ELLIPSIS
        inf
        >>> f.fromBytes(b"not a number") # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        InvalidFloatLiteral: could not convert string to float: not a number

    N)	rv   rw   rx   r|   floatr~   _unicode_convertersr   _validation_errorry   rn   rl   r   r     s    8r E (+rn   r   c                   :     e Zd Zej                  ZeZ fdZ xZS )Datetimec                 ,    t        t        | 
  |i | y rh   )r   r   rm   rj   argskwr   s      rl   rm   zDatetime.__init__K  s    h&33rn   )	rv   rw   rx   r0   r|   r   r~   rm   r   r   s   @rl   r   r   F  s    GE4 4rn   r   c                   :     e Zd Zej                  ZeZ fdZ xZS )Datec                     t         t        |   |       t        |t              r1t        || j                  | j                        j                  | |      y rh   )	r   r   r   
isinstancer   r\   r~   rv   r   r   s     rl   r   zDate._validateT  sJ    dD#E*eX&tzz4==""4/0 'rn   )	rv   rw   rx   r/   r|   r   r~   r   r   r   s   @rl   r   r   O  s    mmGE0 0rn   r   c                   (    e Zd Zej                  ZeZy)	TimedeltaN)rv   rw   rx   rV   r|   r   r~   ry   rn   rl   r   r   \  s      GErn   r   c                   (    e Zd Zej                  ZeZy)TimeN)rv   rw   rx   rU   r|   r   r~   ry   rn   rl   r   r   b  s    mmGErn   r   c                       e Zd ZdZy)MissingVocabularyErrorz/Raised when a named vocabulary cannot be found.Nr   ry   rn   rl   r   r   h  s     :rn   r   c                   "     e Zd ZdZ fdZ xZS )InvalidVocabularyErrorz-Raised when the vocabulary is not an ISource.c                 2    t         t        |   d|       y )NzInvalid vocabulary )r   r   rm   )rj   
vocabularyr   s     rl   rm   zInvalidVocabularyError.__init__u  s    $d4'13	5rn   )rv   rw   rx   r|   rm   r   r   s   @rl   r   r   o  s     85 5rn   r   c                   V     e Zd ZdZd fd	Z ed       Zd Z fdZd Z	 fdZ
 xZS )	ChoicezsChoice fields can have a value found in a constant or dynamic set of
    values given by the field definition.
    c                 p   |=t        |t              s t        j                  |      st	        d      |t	        d      ||}||t	        d      ||t	        d      d| _        d| _        |t        j                  |      | _        nTt        |t              r|| _        n<t        j                  |      s t        j                  |      st        |      || _        t        | j                        xs t        j                  | j
                        | _        t        t        | B  di | d| _        y)zInitialize object.Nz8vocabulary must be a string or implement IBaseVocabularyz.You cannot specify both source and vocabulary.z-You must specify either values or vocabulary.z.You cannot specify both values and vocabulary.Fry   )r   r}   r&   
providedBy
ValueErrorr   vocabularyNamer]   
fromValuesrQ   r.   r   bool_init_fieldr   r   rm   )rj   valuesr   sourcer   r   s        rl   rm   zChoice.__init__  s@   !z3/+66zB  "3 4 4! DF FJNz1?  *"8@  ".99&ADO
C(",D&&z20;;JG,Z88(DO !!4!45 M0;;DOOL 	fd$*r* rn   c                     | j                   S rh   )r   )rj   s    rl   <lambda>zChoice.<lambda>  s
    4?? rn   c                    | j                   }t        j                  |      r| j                   || j                        }n?|=| j                  1t               }	 |j                  | j                  | j                        }t        j                  |      st        |      j                  | |      |S # t        $ r) t        d| j                        j                  | |      w xY w)Nz.Can't validate value without vocabulary named )r   r.   r   contextr   r^   getLookupErrorr   r   rQ   r   )rj   r   r   vrs       rl   _resolve_vocabularyzChoice._resolve_vocabulary  s     __
 ++J7LL,#DLL1JD$7$7$C&(B4VVDLL$2E2EF
 !!*-(4IIe    4,++. '&tU344s   &B2 22C$c                 t    t         t        |   |      }|j                  d      x|_        fd|_        |S ),See zope.schema._bootstrapinterfaces.IField.Nc                     S rh   ry   )r   r   s    rl   r   zChoice.bind.<locals>.<lambda>  s    * rn   )r   r   bindr   r   )rj   r   cloner   r   s      @rl   r   zChoice.bind  s;    fd(1 ).(A(A$(GG
U%$<!rn   c                 (    | j                  |       |S )r   r   r   s     rl   r   zChoice.fromUnicode  s     	ern   c                     | j                   ry t        t        |   |       | j	                  |      }||vr&t        || j                        j                  | |      y rh   )r   r   r   r   r   r$   rv   r   )rj   r   r   r   s      rl   r   zChoice._validate  s^    fd%e,--e4

"(t}}""4/0 #rn   )NNN)rv   rw   rx   r|   rm   propertyr   r   r   r   r   r   r   s   @rl   r   r   z  s4    )!V 23F0	0 	0rn   r   c                       e Zd ZdZd Zd Zy)_StrippedNativeStringLineNc                     |j                         }	 |j                  d      }|j                  d      }| j                  |       |S # t        $ r" | j                  |      j	                  | |      w xY wNr   )stripr   UnicodeEncodeError_invalid_exc_typer   r   r   )rj   r   vs      rl   r   z%_StrippedNativeStringLine.fromUnicode  su    KKM	!A HHWa " 	((/DDe 	s   A +A2c                 B    | j                  |j                  d            S r   )r   r   r   s     rl   r   z#_StrippedNativeStringLine.fromBytes  s    W 566rn   )rv   rw   rx   r   r   r   ry   rn   rl   r   r     s    7rn   r   z[a-zA-z0-9+.-]+:z\S*$c                   "     e Zd ZdZ fdZ xZS )URIa  
    URI schema field.

    URIs can be validated from both unicode values and bytes values,
    producing a native text string in both cases::

        >>> from zope.schema import URI
        >>> field = URI()
        >>> field.fromUnicode(u'   https://example.com  ')
        'https://example.com'
        >>> field.fromBytes(b'   https://example.com ')
        'https://example.com'

    .. versionchanged:: 4.8.0
        Implement :class:`zope.schema.interfaces.IFromBytes`
    c                 x    t         t        |   |       t        |      ry t	        |      j                  | |      rh   )r   r   r   _isurirH   r   r   s     rl   r   zURI._validate  s4    c4"5)%=44T5AArn   rv   rw   rx   r|   r   r   r   s   @rl   r   r     s    "B Brn   r   z[a-zA-Z_]+\w*^$z([.]z)*c                   "     e Zd ZdZ fdZ xZS )PythonIdentifiera   
    This field describes a python identifier, i.e. a variable name.

    Empty strings are allowed.

    Identifiers can be validated from both unicode values and bytes values,
    producing a native text string in both cases::

        >>> from zope.schema import PythonIdentifier
        >>> field = PythonIdentifier()
        >>> field.fromUnicode(u'zope')
        'zope'
        >>> field.fromBytes(b'_zope')
        '_zope'
        >>> field.fromUnicode(u'   ')
        ''

    .. versionadded:: 4.9.0
    c                 ~    t         t        |   |       |r't        |      st	        |      j                  | |      y y rh   )r   r   r   _is_identifierrI   r   r   s     rl   r   zPythonIdentifier._validate@  s<    /6.u%::4GG /5rn   r   r   s   @rl   r   r   *  s    (H Hrn   r   c                   0     e Zd ZdZeZ fdZ fdZ xZS )
DottedNamea  Dotted name field.

    Values of DottedName fields must be Python-style dotted names.

    Dotted names can be validated from both unicode values and bytes values,
    producing a native text string in both cases::

        >>> from zope.schema import DottedName
        >>> field = DottedName()
        >>> field.fromUnicode(u'zope.schema')
        'zope.schema'
        >>> field.fromBytes(b'zope.schema')
        'zope.schema'
        >>> field.fromUnicode(u'zope._schema')
        'zope._schema'

    .. versionchanged:: 4.8.0
        Implement :class:`zope.schema.interfaces.IFromBytes`
    .. versionchanged:: 4.9.0
        Allow leading underscores in each component.
    c                 b   t        |j                  dd            | _        | j                  dk  rt        d      |j                  dd       | _        | j                  >t        | j                        | _        | j                  | j                  k  rt        d      t        t        |   |i | y )Nmin_dotsr   z!min_dots cannot be less than zeromax_dotsz%max_dots cannot be less than min_dots)intpopr   r   r   r   r   rm   r   s      rl   rm   zDottedName.__init__`  s    BFF:q12==1@AAz40==$.DM}}t}}, !HIIj$($5"5rn   c                    t         t        |   |       t        |      st	        |      j                  | |      |j                  d      }|| j                  k  r)t	        d| j                  z  |      j                  | |      | j                  9|| j                  kD  r)t	        d| j                  z  |      j                  | |      yy)z


        .ztoo few dots; %d requiredNz&too many dots; no more than %d allowed)	r   r   r   	_isdottedrF   r   countr   r   )rj   r   dotsr   s      rl   r   zDottedName._validatek  s     	j$)%0#E*??eLL{{3$--#+dmm;U""4/0 ==$)=#84==H%""4/0 *>$rn   )	rv   rw   rx   r|   rF   r   rm   r   r   r   s   @rl   r   r   F  s    , *	60 0rn   r   c                   &     e Zd ZdZeZ fdZ xZS )IdzId field

    Values of id fields must be either uris or dotted names.

    .. versionchanged:: 4.8.0
        Implement :class:`zope.schema.interfaces.IFromBytes`
    c                     t         t        |   |       t        |      ry t	        |      rd|v ry t        |      j                  | |      )Nr  )r   r  r   r   r  rG   r   r   s     rl   r   zId._validate  sE    b$!%(%=Uu33D%@@rn   )rv   rw   rx   r|   rG   r   r   r   r   s   @rl   r  r  }  s     "A Arn   r  c                   6     e Zd Zej                  Z fdZ xZS )InterfaceFieldc                     t         t        |   |       t        j                  |      s&t        || j                        j                  | |      y rh   )r   r
  r   r   r   rX   rv   r   r   s     rl   r   zInterfaceField._validate  sK    nd-e4$$U+  #"4/0 ,rn   )rv   rw   rx   r<   r|   r   r   r   s   @rl   r
  r
    s    %%G0 0rn   r
  c                     |g }| |S |D ]  }	 | j                  |        |S # t        $ r}|j                  |       Y d}~8d}~ww xY w)a8  Validates a sequence value.

    Returns a list of validation errors generated during the validation. If
    no errors are generated, returns an empty list.

    value_type is a field. value is the sequence being validated. errors is
    an optional list of errors that will be prepended to the return value.

    To illustrate, we'll use a text value type. All values must be unicode.

       >>> field = TextLine(required=True)

    To validate a sequence of various values:

       >>> errors = _validate_sequence(field, (bytearray(b'foo'), u'bar', 1))
       >>> errors
       [WrongType(bytearray(b'foo'), <...>, ''), WrongType(1, <...>, '')]

    The only valid value in the sequence is the second item. The others
    generated errors.

    We can use the optional errors argument to collect additional errors
    for a new sequence:

       >>> errors = _validate_sequence(field, (2, u'baz'), errors)
       >>> errors # doctest: +NORMALIZE_WHITESPACE
       [WrongType(bytearray(b'foo'), <...>, ''),
        WrongType(1, <...>, ''),
        WrongType(2, <...>, '')]

    N)r   rZ   append)
value_typer   errorsitemerrors        rl   _validate_sequencer    sd    @ ~ !	!%!
 M  	!MM%  	!s   $	AAAc                 v    g }|D ]2  }||v rt        |      j                  | |      |j                  |       4 y rh   )rY   r   r  )rj   r   temp_valuesr  s       rl   _validate_uniquenessr    sC    K !;D/66tUCC4 	!rn   c                   D     e Zd ZdZdZdZeef fd	Z fdZ fdZ	 xZ
S )
Collectiona  
    A generic collection implementing
    :class:`zope.schema.interfaces.ICollection`.

    Subclasses can define the attribute ``value_type`` to be a field
    such as an :class:`Object` that will be checked for each member of
    the collection. This can then be omitted from the constructor call.

    They can also define the attribute ``_type`` to be a concrete
    class (or tuple of classes) that the collection itself will
    be checked to be an instance of. This cannot be set in the constructor.

    .. versionchanged:: 4.6.0
       Add the ability for subclasses to specify ``value_type``
       and ``unique``, and allow eliding them from the constructor.
    NFc                     t        t        | 
  di | |t        ur|| _        | j                  *t        j                  | j                        st        d      |t        ur|| _        y y )N$'value_type' must be field instance.ry   )	r   r  rm   r    r  r4   r   r   unique)rj   r  r  r   r   s       rl   rm   zCollection.__init__  s`    j$(.2.Y&(DOOO'))$//:CDD" DK #rn   c                     t         t        |   |      }|j                   |j                  j                  |      |_        |S r   )r   r  r   r  )rj   r   r   r   s      rl   r   zCollection.bind  s@    j$,W5 '$//44W=Ern   c                     t         t        |   |       t        | j                  |      }|r'	 t        || j                        j                  | |      | j                  rt        | |       y y # ~w xY wrh   )
r   r  r   r  r  r[   rv   r   r  r  rj   r   r  r   s      rl   r   zCollection._validate  sl    j$)%0#DOOU;(DMM&&tU34 ;; u-  s   &A. .A1)rv   rw   rx   r|   r  r  r    rm   r   r   r   r   s   @rl   r  r    s-      JF"+I 
!. .rn   r  c                   (    e Zd ZdZej
                  Zy)SequencezP
    A field representing an ordered sequence.

    .. versionadded:: 4.6.0
    N)rv   rw   rx   r|   r   r   r~   ry   rn   rl   r   r     s    
 LLErn   r   c                       e Zd ZdZeZy)TuplezA field representing a Tuple.N)rv   rw   rx   r|   tupler~   ry   rn   rl   r"  r"    s
    'Ern   r"  c                   (    e Zd ZdZej
                  Zy)MutableSequencezO
    A field representing a mutable sequence.

    .. versionadded:: 4.6.0
    N)rv   rw   rx   r|   r   r%  r~   ry   rn   rl   r%  r%  %  s    
 Ern   r%  c                       e Zd ZdZeZy)ListzA field representing a List.N)rv   rw   rx   r|   listr~   ry   rn   rl   r'  r'  /  
    &Ern   r'  c                   "     e Zd ZdZ fdZ xZS )_AbstractSetTc                 Z    t        t        | 
  |i | | j                  st	        d      y )Nz6__init__() got an unexpected keyword argument 'unique')r   r+  rm   r  	TypeError)rj   r   kwargsr   s      rl   rm   z_AbstractSet.__init__8  s5    lD*D;F;{{HJ J rn   )rv   rw   rx   r  rm   r   r   s   @rl   r+  r+  5  s    FJ Jrn   r+  c                       e Zd ZdZeZy)SetzA field representing a set.N)rv   rw   rx   r|   setr~   ry   rn   rl   r0  r0  ?  s
    %Ern   r0  c                       e Zd ZeZy)	FrozenSetN)rv   rw   rx   	frozensetr~   ry   rn   rl   r3  r3  E  s    Ern   r3  c                   X     e Zd ZdZej
                  ZdZdZd fd	Z	 fdZ
 fdZ xZS )MappingzF
    A field representing a mapping.

    .. versionadded:: 4.6.0
    Nc                     t        t        | 
  di | | t        j                  |      st        d      | t        j                  |      st        d      || _        || _        y )Nz"'key_type' must be field instance.r  ry   )r   r6  rm   r4   r   r   key_typer  )rj   r8  r  r   r   s       rl   rm   zMapping.__init__U  sa    gt%++(9(9((CABB!&*;*;J*GCDD $rn   c                    t         t        |   |       g }| j                  r%t	        | j                  |j                         |      }t	        | j                  ||      }|r'	 t        || j                        j                  | |      y # ~w xY wrh   )
r   r6  r   r  r  r   r8  r[   rv   r   r  s      rl   r   zMapping._validate_  s    gt&u-??'(.0F#DMM5&A(DMM&&tU34  s   "&B	 	Bc                     t         t        |   |      }|j                   |j                  j                  |      |_        |j                   |j                  j                  |      |_        |S r  )r   r6  r   r8  r  )rj   objectr   r   s      rl   r   zMapping.bindp  s`    gt)&1 >>%"^^008EN'$//44V<Ern   )NN)rv   rw   rx   r|   r   r6  r~   r8  r  rm   r   r   r   r   s   @rl   r6  r6  J  s1    
 KKEHJ%"	 	rn   r6  c                   (    e Zd ZdZej
                  Zy)MutableMappingzN
    A field representing a mutable mapping.

    .. versionadded:: 4.6.0
    N)rv   rw   rx   r|   r   r=  r~   ry   rn   rl   r=  r=  |  s    
 Ern   r=  c                       e Zd ZdZeZy)DictzA field representing a Dict.N)rv   rw   rx   r|   dictr~   ry   rn   rl   r?  r?    r)  rn   r?  rh   )r|   __docformat__recollectionsr   r   r   r   r   zope.interfacer	   r
   r   r   zope.interface.interfacesr   zope.schema._bootstrapfieldsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    zope.schema.fieldpropertyr!   zope.schema.interfacesr"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   zope.schema.vocabularyr]   r^   r_   r`   ra   rb   rc   rd   r;  rf   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r-  r   r   r   r   compilematchr   _identifier_patternr   r  r   r   r  r
  r  r  r  AbstractCollectionr   r"  r%  r'  r+  r0  r3  r6  r=  r?  ry   rn   rl   <module>rN     s  " 	      * / ( & 0 - 0 2 0 . , 1 1 2 / / 2 1 1 - - 1 2 3 ) ' 9 - 2 ( ) - * . + - 7 ( , + ( . ) ) - / - & ' , 2 , ( + - 2 3 0 4 * 4 , - / * , 4 , ( , ' * . ( , ( - ) 1 , 2 5 , 3 8 F7O,!&"78 vj12vj12 v $Z%=>	 $Z%=>	  T5 ! Xy ) Xy ) T5 ! Xy ) Y
 + VW % Wh ' T5 ! Xy ) Xy ) S$  Wh ' VW %0F 0( [  
 V\:.Iu  / }lJ?4  @( VCL C C Z" " " (,
Cx  D* Z! ! !"*o " V<,D <, <,~ Y4y% 4 4 U	09e 	0 	0 Z	5  
 U9e  
:_'(:5_'&5 Wl#b0U b0 $b0R7 0 7, 
 ' 	F		!	! TB
# B B8 '  C"55;<BBBJJ
#$&+, 	 E 
 H0 H  H6 [30* 30 30l SA	" A A* _	0U 	0 	0)X! [5.H 5. 5.x    Yz   VH  
  h     U?  
J: J T,  
 Z   X.i . .b _W   U>  rn   