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:
@@ -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 ():
|
||||
|
||||
Reference in New Issue
Block a user