Skip to content

Commit

Permalink
Minor docstring cleanups for NamedList.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Nov 14, 2023
1 parent 86fa4cb commit de99af3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/biocutils/NamedList.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_slice(self, index: SubscriptTypes) -> "NamedList":
:py:func:`~biocutils.normalize_subscript.normalize_subscript`
for details. Strings are matched to names in the current
object, using the first occurrence if duplicate names are
present. Scalars are treated as length-1 vectors.
present. Scalars are treated as length-1 sequences.
Returns:
A ``NamedList`` is returned containing the specified subset.
Expand All @@ -186,7 +186,7 @@ def get_slice(self, index: SubscriptTypes) -> "NamedList":

def __getitem__(self, index: SubscriptTypes) -> Union["NamedList", Any]:
"""
If ``index`` is a scalar, this is an alias for :py:attr:`~get_item`.
If ``index`` is a scalar, this is an alias for :py:attr:`~get_value`.
If ``index`` is a sequence, this is an alias for :py:attr:`~get_slice`.
"""
Expand Down Expand Up @@ -251,7 +251,7 @@ def set_slice(self, index: SubscriptTypes, value: Sequence, in_place: bool = Fal
:py:func:`~biocutils.normalize_subscript.normalize_subscript`
for details. Strings are matched to names in the current
object, using the first occurrence if duplicate names are
present.
present. Scalars are treated as length-1 sequences.
value:
If ``index`` is a sequence, a sequence of the same length
Expand Down Expand Up @@ -287,10 +287,10 @@ def set_slice(self, index: SubscriptTypes, value: Sequence, in_place: bool = Fal

def __setitem__(self, index: SubscriptTypes, value: Any):
"""
If ``index`` is a scalar, this is an alias for :py:attr:`~set_item`
If ``index`` is a scalar, this is an alias for :py:attr:`~set_value`
with ``in_place = True``.
If ``index`` is a sequence, this is an alias for :py:attr:`~get_slice`
If ``index`` is a sequence, this is an alias for :py:attr:`~set_slice`
with ``in_place = True``.
"""
if isinstance(index, str):
Expand Down Expand Up @@ -368,7 +368,7 @@ def append(self, value: Any):
"""Alias for :py:attr:`~safe_append` with `in_place = True`."""
self.safe_append(value, in_place=True)

def safe_extend(self, other: Iterable, in_place: bool = False):
def safe_extend(self, other: Iterable, in_place: bool = False) -> "NamedList":
"""
Args:
iterable:
Expand Down

0 comments on commit de99af3

Please sign in to comment.