
    .Phv                     6    d dl Z ddlmZ  G d de          ZdS )    N   )method_cachec                   n     e Zd ZdZd Zd Zd Zd Zd Z fdZ	d Z
e fd	            Zd
 ZddZ xZS )
FoldedCasea{  
    A case insensitive string class; behaves just like str
    except compares equal when the only variation is case.

    >>> s = FoldedCase('hello world')

    >>> s == 'Hello World'
    True

    >>> 'Hello World' == s
    True

    >>> s != 'Hello World'
    False

    >>> s.index('O')
    4

    >>> s.split('O')
    ['hell', ' w', 'rld']

    >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta']))
    ['alpha', 'Beta', 'GAMMA']

    Sequence membership is straightforward.

    >>> "Hello World" in [s]
    True
    >>> s in ["Hello World"]
    True

    You may test for set inclusion, but candidate and elements
    must both be folded.

    >>> FoldedCase("Hello World") in {s}
    True
    >>> s in {FoldedCase("Hello World")}
    True

    String inclusion works as long as the FoldedCase object
    is on the right.

    >>> "hello" in FoldedCase("Hello World")
    True

    But not if the FoldedCase object is on the left:

    >>> FoldedCase('hello') in 'Hello World'
    False

    In that case, use in_:

    >>> FoldedCase('hello').in_('Hello World')
    True

    >>> FoldedCase('hello') > FoldedCase('Hello')
    False
    c                 V    |                                  |                                 k     S Nlowerselfothers     X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/importlib_metadata/_text.py__lt__zFoldedCase.__lt__C       zz||ekkmm++    c                 V    |                                  |                                 k    S r   r	   r   s     r   __gt__zFoldedCase.__gt__F   r   r   c                 V    |                                  |                                 k    S r   r	   r   s     r   __eq__zFoldedCase.__eq__I       zz||u{{}},,r   c                 V    |                                  |                                 k    S r   r	   r   s     r   __ne__zFoldedCase.__ne__L   r   r   c                 D    t          |                                           S r   )hashr
   )r   s    r   __hash__zFoldedCase.__hash__O   s    DJJLL!!!r   c                     t                                                                          |                                          S r   )superr
   __contains__)r   r   	__class__s     r   r   zFoldedCase.__contains__R   s+    ww}}++EKKMM:::r   c                 $    | t          |          v S )zDoes self appear in other?)r   r   s     r   in_zFoldedCase.in_U   s    z%((((r   c                 D    t                                                      S r   )r   r
   )r   r   s    r   r
   zFoldedCase.lowerZ   s    ww}}r   c                 t    |                                                      |                                           S r   )r
   index)r   subs     r   r$   zFoldedCase.index^   s&    zz||!!#))++...r    r   c                     t          j        t          j        |          t           j                  }|                    | |          S r   )recompileescapeIsplit)r   splittermaxsplitpatterns       r   r,   zFoldedCase.splita   s3    *RYx00"$77}}T8,,,r   )r&   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r!   r   r
   r$   r,   __classcell__)r   s   @r   r   r      s        9 9v, , ,, , ,- - -- - -" " "; ; ; ; ;) ) )
     \/ / /- - - - - - - -r   r   )r(   
_functoolsr   strr    r   r   <module>r8      s^    				 $ $ $ $ $ $\- \- \- \- \- \- \- \- \- \-r   