Viewing File: /opt/alt/python37/lib/python3.7/site-packages/importlib_metadata/__pycache__/_text.cpython-37.pyc

B

�&�`��@s(ddlZddlmZGdd�de�ZdS)�N�)�method_cachecsreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z�fdd
�Z	dd�Z
e�fdd��Zdd�Z
ddd�Z�ZS)�
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
    cCs|��|��kS)N)�lower)�self�other�r�I/opt/alt/python37/lib/python3.7/site-packages/importlib_metadata/_text.py�__lt__CszFoldedCase.__lt__cCs|��|��kS)N)r)rrrrr	�__gt__FszFoldedCase.__gt__cCs|��|��kS)N)r)rrrrr	�__eq__IszFoldedCase.__eq__cCs|��|��kS)N)r)rrrrr	�__ne__LszFoldedCase.__ne__cCst|���S)N)�hashr)rrrr	�__hash__OszFoldedCase.__hash__cstt|����|���S)N)�superrr�__contains__)rr)�	__class__rr	rRszFoldedCase.__contains__cCs|t|�kS)zDoes self appear in other?)r)rrrrr	�in_UszFoldedCase.in_cstt|���S)N)rrr)r)rrr	rZszFoldedCase.lowercCs|���|���S)N)r�index)r�subrrr	r^szFoldedCase.index� rcCs t�t�|�tj�}|�||�S)N)�re�compile�escape�I�split)r�splitter�maxsplit�patternrrr	raszFoldedCase.split)rr)�__name__�
__module__�__qualname__�__doc__r
rrr
rrrrrrr�
__classcell__rr)rr	rs:r)r�
_functoolsr�strrrrrr	�<module>s
Back to Directory File Manager