Skip to content

Commit

Permalink
refactor: Be less strict in Numpy regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Apr 3, 2022
1 parent 4407244 commit 603dc0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/griffe/docstrings/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def _read_block(docstring: Docstring, offset: int) -> tuple[str, int]: # noqa:
_RE_OB: str = r"\{" # opening bracket
_RE_CB: str = r"\}" # closing bracket
_RE_NAME: str = r"\*{0,2}[_a-z][_a-z0-9]*"
_RE_TYPE: str = r"[_a-z0-9 \[\]|().,'\"-]+"
_RE_RETURNS: Pattern = re.compile(rf"^(?:(?P<name>{_RE_NAME}) : )?(?P<type>{_RE_TYPE})", re.IGNORECASE)
_RE_TYPE: str = r"[_a-z0-9 \[\]|().,'\"-]*"
_RE_RETURNS: Pattern = re.compile(rf"^(?:(?P<name>{_RE_NAME}) ?: ?)?(?P<type>{_RE_TYPE})", re.IGNORECASE)
_RE_YIELDS: Pattern = _RE_RETURNS
_RE_RECEIVES: Pattern = _RE_YIELDS
_RE_PARAMETER: Pattern = re.compile(
Expand Down

0 comments on commit 603dc0e

Please sign in to comment.