5
5
6
6
7
7
def is_nonstring_sequence (obj ):
8
+ """Check if a given object is a non-string sequence.
9
+
10
+ :param obj: Any object to check.
11
+ :return: `True` if `obj` is a non-string :class:`Sequence` instance.
12
+ :rtype: :class:`bool`
13
+ """
8
14
return (
9
15
isinstance (obj , collections .abc .Sequence )
10
16
and not isinstance (obj , collections .abc .ByteString )
@@ -15,7 +21,10 @@ def is_nonstring_sequence(obj):
15
21
def make_repr (obj , * args , ** kwargs ):
16
22
"""Make a representation string with ease.
17
23
18
- :param obj: Any object to get a representation.
24
+ :param obj: Any object to make a representation for.
25
+ :param *args: Attributes names to include.
26
+ :type *args: :class:`str`
27
+ :param **kwargs: Other `attribute_name=any_value` to include.
19
28
:return: String representation of `obj`.
20
29
:rtype: :class:`str`
21
30
"""
@@ -27,8 +36,12 @@ def make_repr(obj, *args, **kwargs):
27
36
28
37
29
38
def attrs_eq (a , b , * args ):
30
- """Compare two objects with their attributs .
39
+ """Compare two objects according to their attributes .
31
40
41
+ :param a: First object to compare.
42
+ :param b: Second object to compare.
43
+ :param *args: Attributes names to check for.
44
+ :type *args: :class:`str`
32
45
:return: `True` if all provided attributes of objects `a` and `b` are equals.
33
46
:rtype: :class:`bool`
34
47
"""
0 commit comments