From b1b82208b852d77bdc80ba9b4143db7e3bae769c Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 11 Sep 2020 14:02:56 +0000 Subject: [PATCH] Fix deprecation warnings due to invalid escape sequences. --- callee/base.py | 2 +- callee/collections.py | 2 +- callee/numbers.py | 6 +++--- callee/operators.py | 4 ++-- callee/types.py | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/callee/base.py b/callee/base.py index 2ec63ca..523e3f9 100644 --- a/callee/base.py +++ b/callee/base.py @@ -147,7 +147,7 @@ class Matcher(BaseMatcher): for better error messages. """ def __repr__(self): - """Provides a default ``repr``\ esentation for custom matchers. + r"""Provides a default ``repr``\ esentation for custom matchers. This representation will include matcher class name and the values of its public attributes. diff --git a/callee/collections.py b/callee/collections.py index ae7360d..ee76532 100644 --- a/callee/collections.py +++ b/callee/collections.py @@ -95,7 +95,7 @@ def __init__(self): class Generator(BaseMatcher): - """Matches an iterable that's a generator. + r"""Matches an iterable that's a generator. A generator can be a generator expression ("comprehension") or an invocation of a generator function (one that ``yield``\ s objects). diff --git a/callee/numbers.py b/callee/numbers.py index 064c283..e76928f 100644 --- a/callee/numbers.py +++ b/callee/numbers.py @@ -43,7 +43,7 @@ class Number(NumericMatcher): class Complex(NumericMatcher): - """Matches any complex number. + r"""Matches any complex number. This *includes* all real, rational, and integer numbers as well, which in Python translates to `float`\ s, fractions, and `int`\ egers. @@ -57,7 +57,7 @@ class Complex(NumericMatcher): class Real(NumericMatcher): - """Matches any real number. + r"""Matches any real number. This includes all rational and integer numbers as well, which in Python translates to fractions, and `int`\ egers. @@ -72,7 +72,7 @@ class Float(NumericMatcher): class Rational(NumericMatcher): - """Matches a rational number. + r"""Matches a rational number. This includes all `int`\ eger numbers as well. """ CLASS = numbers.Rational diff --git a/callee/operators.py b/callee/operators.py index 2288086..f3fb39a 100644 --- a/callee/operators.py +++ b/callee/operators.py @@ -185,7 +185,7 @@ class Shorter(LengthMatcher): class ShorterOrEqual(LengthMatcher): - """Matches values that are shorter than, + r"""Matches values that are shorter than, or equal in ``len``\ gth to (as per ``<=`` operator), given object. """ OP = operator.le @@ -203,7 +203,7 @@ class Longer(LengthMatcher): class LongerOrEqual(LengthMatcher): - """Matches values that are longer than, + r"""Matches values that are longer than, or equal in ``len``\ gth to (as per ``>=`` operator), given object. """ OP = operator.ge diff --git a/callee/types.py b/callee/types.py index 78f1a5b..8d61898 100644 --- a/callee/types.py +++ b/callee/types.py @@ -16,7 +16,7 @@ class TypeMatcher(BaseMatcher): This class shouldn't be used directly. """ def __init__(self, type_): - """:param type\ _: Type to match against""" + r""":param type\ _: Type to match against""" if not isinstance(type_, type): raise TypeError("%s requires a type, got %r" % ( self.__class__.__name__, type_)) @@ -32,7 +32,7 @@ class InstanceOf(TypeMatcher): (as per `isinstance`). """ def __init__(self, type_, exact=False): - """ + r""" :param type\ _: Type to match against :param exact: @@ -58,7 +58,7 @@ class SubclassOf(TypeMatcher): (as per `issubclass`). """ def __init__(self, type_, strict=False): - """ + r""" :param type\ _: Type to match against :param strict: