From: Sarah Hoffmann Date: Wed, 11 May 2022 08:25:00 +0000 (+0200) Subject: pylint: disable no-self-use check X-Git-Tag: v4.1.0~43^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/d14a585cc92c1558c23ca86855474f14fd711cb2?ds=sidebyside;hp=-c pylint: disable no-self-use check This checker encourages bad behaviour (namely changing the static status of a function during inheritence) and will be made optional in upcoming versions of pylint. --- d14a585cc92c1558c23ca86855474f14fd711cb2 diff --git a/.pylintrc b/.pylintrc index 89135138..fef53872 100644 --- a/.pylintrc +++ b/.pylintrc @@ -11,6 +11,6 @@ ignored-modules=icu,datrie # 'with' statements. ignored-classes=NominatimArgs,closing # 'too-many-ancestors' is triggered already by deriving from UserDict -disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value +disable=too-few-public-methods,duplicate-code,too-many-ancestors,bad-option-value,no-self-use good-names=i,x,y,fd,db diff --git a/nominatim/tokenizer/icu_tokenizer.py b/nominatim/tokenizer/icu_tokenizer.py index 9c7138ce..bf5544ed 100644 --- a/nominatim/tokenizer/icu_tokenizer.py +++ b/nominatim/tokenizer/icu_tokenizer.py @@ -278,8 +278,7 @@ class LegacyICUNameAnalyzer(AbstractAnalyzer): + [(k, v, part_ids.get(v, None)) for k, v in partial_tokens.items()] - @staticmethod - def normalize_postcode(postcode): + def normalize_postcode(self, postcode): """ Convert the postcode to a standardized form. This function must yield exactly the same result as the SQL function diff --git a/nominatim/tokenizer/legacy_tokenizer.py b/nominatim/tokenizer/legacy_tokenizer.py index 299e2fde..7b78b22a 100644 --- a/nominatim/tokenizer/legacy_tokenizer.py +++ b/nominatim/tokenizer/legacy_tokenizer.py @@ -337,8 +337,7 @@ class LegacyNameAnalyzer(AbstractAnalyzer): return self.normalizer.transliterate(phrase) - @staticmethod - def normalize_postcode(postcode): + def normalize_postcode(self, postcode): """ Convert the postcode to a standardized form. This function must yield exactly the same result as the SQL function