From 6bb577e885bd03589af261291c9cb80b6e074b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:38:05 +0100 Subject: [PATCH] Allow passed match callback to have different parameter names. As the callback is called with positional arguments, the signature should reflect that. --- python/pyperscan/_pyperscan.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyperscan/_pyperscan.pyi b/python/pyperscan/_pyperscan.pyi index c5d1e64..142f554 100644 --- a/python/pyperscan/_pyperscan.pyi +++ b/python/pyperscan/_pyperscan.pyi @@ -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]