Ë
c‡½jv ã ó. — d dl Z ddlmZ G d„ de« Zy)é Né )Úmethod_cachec óh ‡ — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zˆ fd„Z d„ Z
eˆ fd „« Zd
„ Z
dd„Zˆ xZS )
Ú
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 óD — | j « |j « k S ©N©Úlower©ÚselfÚothers ú1/usr/lib64/python3.12/importlib/metadata/_text.pyÚ__lt__zFoldedCase.__lt__C ó € Ø�z‰z‹|˜eŸk™k›mÑ+Ð+ó c óD — | j « |j « kD S r r r s r Ú__gt__zFoldedCase.__gt__F r r c óD — | j « |j « k( S r r r s r Ú__eq__zFoldedCase.__eq__I ó € Ø�z‰z‹|˜uŸ{™{›}Ñ,Ð,r c óD — | j « |j « k7 S r r r s r Ú__ne__zFoldedCase.__ne__L r r c ó4 — t | j « « S r )Úhashr
)r s r Ú__hash__zFoldedCase.__hash__O s € Ü�D—J‘J“LÓ!Ð!r c óZ •— t ‰| � « j |j « « S r )Úsuperr
Ú__contains__)r r
Ú __class__s €r r zFoldedCase.__contains__R s ø€ ܉w‰}‹×+Ñ+¨E¯K©K«MÓ:Ð:r c ó — | t |« v S )zDoes self appear in other?)r r s r Úin_zFoldedCase.in_U s € à”z %Ó(Ð(Ð(r c ó •— t ‰| � « S r )r r
)r r s €r r
zFoldedCase.lowerZ s ø€ ä‰w‰}‹Ðr c ó\ — | j « j |j « « S r )r
Úindex)r Úsubs r r$ zFoldedCase.index^ s € Ø�z‰z‹|×!Ñ! #§)¡)£+Ó.Ð.r c ó” — t j t j |« t j « }|j | |« S r )ÚreÚcompileÚescapeÚIÚsplit)r ÚsplitterÚmaxsplitÚpatterns r r+ zFoldedCase.splita s0 € Ü—*‘*œRŸY™Y xÓ0´"·$±$Ó7ˆØ�}‰}˜T 8Ó,Ð,r )Ú r )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r r! r r
r$ r+ Ú
__classcell__)r s @r r r sJ ø„ ñ9òv,ò,ò-ò-ò"ô;ò)ð
óó ðò/÷-r r )r' Ú
_functoolsr Ústrr © r r Ú