Skip to content

Commit

Permalink
copy docstrings to renum.pyi
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyrkul committed Apr 14, 2024
1 parent 5845f75 commit 9ed21c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions renum/renum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class _Scanner[_renumT: renum](Scanner[str]): # type: ignore
def search(self) -> _renumT | None: ...

class RenumType(EnumMeta, regex.Pattern[str]): # type: ignore
"""Metaclass for renum classes"""

# flags is actually implemented in __init_subclass__,
# but pyright doesn't pick up on that
def __new__[_RenumTypeT: RenumType](
Expand Down Expand Up @@ -107,7 +109,15 @@ class RenumType(EnumMeta, regex.Pattern[str]): # type: ignore
"""

class renum(Enum, regex.Match[str], metaclass=RenumType): # type: ignore
"""
A utility class for generating Enum-like regular expression patterns.
Parameters:
flags (int | regex.RegexFlag): Regular expression flags to pass to `regex.compile`
"""

_value_: str

@overload
def __new__(cls, value: str = ..., /) -> Self: ...
@overload
Expand Down

0 comments on commit 9ed21c4

Please sign in to comment.