remove @staticmethod decorators

There might have been a time when calling a static method was faster
than a regular method, but that is no longer the case. According to
micro-benchmarks, it is 70% slower in CPython 3.13 and it also makes
executing the code of a class definition slower.
This commit is contained in:
Mike Fährmann
2025-06-12 22:13:46 +02:00
parent 8b6bc54e95
commit 811b665e33
68 changed files with 139 additions and 252 deletions

View File

@@ -280,8 +280,7 @@ class DeviantartExtractor(Extractor):
deviation["index_base36"],
))
@staticmethod
def commit(deviation, target):
def commit(self, deviation, target):
url = target["src"]
name = target.get("filename") or url
target = target.copy()
@@ -680,8 +679,7 @@ x2="45.4107524%" y2="71.4898596%" id="app-root-3">\
return content
@staticmethod
def _find_folder(folders, name, uuid):
def _find_folder(self, folders, name, uuid):
if uuid.isdecimal():
match = util.re(
"(?i)" + name.replace("-", "[^a-z0-9]+") + "$").match
@@ -1889,8 +1887,7 @@ class DeviantartOAuthAPI():
result.extend(self._pagination(endpoint, params, False, key=key))
return result
@staticmethod
def _shared_content(results):
def _shared_content(self, results):
"""Return an iterable of shared deviations in 'results'"""
for result in results:
for item in result.get("items") or ():