Skip to content

Commit

Permalink
Allow passed match callback to have different parameter names.
Browse files Browse the repository at this point in the history
As the callback is called with positional arguments, the signature
should reflect that.
  • Loading branch information
vlaci committed Jan 19, 2024
1 parent 76f07b6 commit 6bb577e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/pyperscan/_pyperscan.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ class OnMatch(Protocol, Generic[_TContext_contra]):
"""Callback called on match."""

def __call__(
self, context: _TContext_contra, tag: Any, start: int, end: Any
self, context: _TContext_contra, tag: Any, start: int, end: int, /
) -> Scan:
"""Called when a match happens.
Note:
Call parameters are passed positonally.
Call parameters are passed positionally.
Args:
context: Object passed to [Database.build][pyperscan._pyperscan.Database.build]
Expand Down

0 comments on commit 6bb577e

Please sign in to comment.