o ?Og@s(ddlZddlmZGdddeZdS)N) method_cachecsreZdZdZddZddZddZdd Zd d Zfd d Z ddZ e fddZ ddZ dddZZS) 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||kSNlowerselfotherr ?/opt/alt/python310/lib64/python3.10/importlib/metadata/_text.py__lt__CzFoldedCase.__lt__cCs||kSrrrr r r __gt__FrzFoldedCase.__gt__cCs||kSrrrr r r __eq__IrzFoldedCase.__eq__cCs||kSrrrr r r __ne__LrzFoldedCase.__ne__cCs t|Sr)hashrr r r r __hash__Os zFoldedCase.__hash__cstt||Sr)superrr __contains__r __class__r r rRszFoldedCase.__contains__cCs |t|vS)zDoes self appear in other?)rrr r r in_Us zFoldedCase.in_cstt|Sr)rrrrrr r rZszFoldedCase.lowercCs||Sr)rindex)r subr r r r^szFoldedCase.index rcCs tt|tj}|||Sr)recompileescapeIsplit)r Zsplittermaxsplitpatternr r r r!as zFoldedCase.split)rr)__name__ __module__ __qualname____doc__r rrrrrrrrrr! __classcell__r r rr rs; r)r _functoolsrstrrr r r r s