Commits

Sergey Schetinin committed 2dcf827

deprecate .weak_match(..)

  • Participants
  • Parent commits 291a6b2

Comments (0)

Files changed (1)

File webob/etag.py

 """
 
 from webob.datetime_utils import *
-from webob.util import header_docstring
+from webob.util import header_docstring, warn_deprecation
 
 __all__ = ['AnyETag', 'NoETag', 'ETagMatcher', 'IfRange', 'NoIfRange', 'etag_property']
 
         del req.environ[key]
     return property(fget, fset, fdel, doc=doc)
 
+def _warn_weak_match_deprecated():
+    warn_deprecation("weak_match is deprecated", '1.2', 3)
+
 
 class _AnyETag(object):
     """
         return True
 
     def weak_match(self, other):
+        _warn_weak_match_deprecated()
         return True
 
     def __str__(self):
         return False
 
     def weak_match(self, other):
+        _warn_weak_match_deprecated()
         return False
 
     def __str__(self):
     def __contains__(self, other):
         return other in self.etags or other in self.weak_etags
 
-    # TODO: deprecate weak_match
     def weak_match(self, other):
+        _warn_weak_match_deprecated()
         if other.lower().startswith('w/'):
             other = other[2:]
         return other in self.etags or other in self.weak_etags