Skip to content

Commit aafff78

Browse files
LeMinawfblanchetNaN
authored andcommitted
docs: improve utils docs
1 parent 686f8fb commit aafff78

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

incipyt/_internal/utils.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66

77
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+
"""
814
return (
915
isinstance(obj, collections.abc.Sequence)
1016
and not isinstance(obj, collections.abc.ByteString)
@@ -15,7 +21,10 @@ def is_nonstring_sequence(obj):
1521
def make_repr(obj, *args, **kwargs):
1622
"""Make a representation string with ease.
1723
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.
1928
:return: String representation of `obj`.
2029
:rtype: :class:`str`
2130
"""
@@ -27,8 +36,12 @@ def make_repr(obj, *args, **kwargs):
2736

2837

2938
def attrs_eq(a, b, *args):
30-
"""Compare two objects with their attributs.
39+
"""Compare two objects according to their attributes.
3140
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`
3245
:return: `True` if all provided attributes of objects `a` and `b` are equals.
3346
:rtype: :class:`bool`
3447
"""

0 commit comments

Comments
 (0)