You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow Choice to ignore case by passing an optional parameter to its __init__ method.
When applied, the filter should return the matching choice (i.e., automatically "fix" case mismatch).
Example:
>>>Choice(choices={'MOE', 'LARRY', 'CURLY', 'SHEMP'}, case_sensitive=False)\
... .apply('Moe')
MOE# (changed to UPPERCASE to match valid choice)
Note that this yields a different result than using case folding:
>>> (CaseFold|Choice(choices={'MOE', 'LARRY', 'CURLY', 'SHEMP'}))\
... .apply('Moe')
# Input is case-folded before Choice filter sees it, so it doesn't match anything.FilterError: Validoptionsare: ['CURLY', 'LARRY', 'MOE', 'SHEMP']
The text was updated successfully, but these errors were encountered:
Allow
Choice
to ignore case by passing an optional parameter to its__init__
method.When applied, the filter should return the matching choice (i.e., automatically "fix" case mismatch).
Example:
Note that this yields a different result than using case folding:
The text was updated successfully, but these errors were encountered: