[mypy/fix] Incompatible types in assignment (expression has type "staticmethod", variable has type "Callable[[ETag], Any]")
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 19 Dec 2019 01:04:07 +0100
changeset 12829 0e9ce897dfdf
parent 12828 dadbd4148a44
child 12830 5318da3497e8
[mypy/fix] Incompatible types in assignment (expression has type "staticmethod", variable has type "Callable[[ETag], Any]")
cubicweb/web/http_headers.py
--- a/cubicweb/web/http_headers.py	Thu Dec 19 10:31:49 2019 +0100
+++ b/cubicweb/web/http_headers.py	Thu Dec 19 01:04:07 2019 +0100
@@ -899,6 +899,7 @@
     def __repr__(self):
         return "Etag(%r, weak=%r)" % (self.tag, self.weak)
 
+    @staticmethod
     def parse(tokens):
         tokens = tuple(tokens)
         if len(tokens) == 1 and not isinstance(tokens[0], Token):
@@ -910,8 +911,6 @@
 
         raise ValueError("Invalid ETag.")
 
-    parse = staticmethod(parse)
-
     def generate(self):
         if self.weak:
             return 'W/'+quoteString(self.tag)