[commands] Case insensitivity uses casefold instead of lower
There seems to be very little performance regression in doing so (+5ns) so might as well go for the more correct behaviour.
This commit is contained in:
		| @@ -105,22 +105,22 @@ def _convert_to_bool(argument): | |||||||
|  |  | ||||||
| class _CaseInsensitiveDict(dict): | class _CaseInsensitiveDict(dict): | ||||||
|     def __contains__(self, k): |     def __contains__(self, k): | ||||||
|         return super().__contains__(k.lower()) |         return super().__contains__(k.casefold()) | ||||||
|  |  | ||||||
|     def __delitem__(self, k): |     def __delitem__(self, k): | ||||||
|         return super().__delitem__(k.lower()) |         return super().__delitem__(k.casefold()) | ||||||
|  |  | ||||||
|     def __getitem__(self, k): |     def __getitem__(self, k): | ||||||
|         return super().__getitem__(k.lower()) |         return super().__getitem__(k.casefold()) | ||||||
|  |  | ||||||
|     def get(self, k, default=None): |     def get(self, k, default=None): | ||||||
|         return super().get(k.lower(), default) |         return super().get(k.casefold(), default) | ||||||
|  |  | ||||||
|     def pop(self, k, default=None): |     def pop(self, k, default=None): | ||||||
|         return super().pop(k.lower(), default) |         return super().pop(k.casefold(), default) | ||||||
|  |  | ||||||
|     def __setitem__(self, k, v): |     def __setitem__(self, k, v): | ||||||
|         super().__setitem__(k.lower(), v) |         super().__setitem__(k.casefold(), v) | ||||||
|  |  | ||||||
| class Command(_BaseCommand): | class Command(_BaseCommand): | ||||||
|     r"""A class that implements the protocol for a bot text command. |     r"""A class that implements the protocol for a bot text command. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user