From 23e886886249ebe8f80a48b0d25fbb5308eeb06f Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 18 Jan 2023 19:11:18 +0100 Subject: Refs #34233 -- Used str.removeprefix()/removesuffix(). --- docs/howto/custom-lookups.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/howto/custom-lookups.txt b/docs/howto/custom-lookups.txt index 2a7ae4a5e5..59f3d30e2d 100644 --- a/docs/howto/custom-lookups.txt +++ b/docs/howto/custom-lookups.txt @@ -312,7 +312,7 @@ would override ``get_lookup`` with something like:: def get_lookup(self, lookup_name): if lookup_name.startswith('x'): try: - dimension = int(lookup_name[1:]) + dimension = int(lookup_name.removeprefix("x")) except ValueError: pass else: -- cgit v1.3