Skip to content

Commit

Permalink
follow-up
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed May 8, 2024
1 parent bb5fc3e commit 1572fe7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H

| | Linux | macOS | Windows |
| :--- | :---: | :---: | :---: |
| Chromium <!-- GEN:chromium-version -->125.0.6422.14<!-- GEN:stop --> ||||
| Chromium <!-- GEN:chromium-version -->125.0.6422.26<!-- GEN:stop --> ||||
| WebKit <!-- GEN:webkit-version -->17.4<!-- GEN:stop --> ||||
| Firefox <!-- GEN:firefox-version -->125.0.1<!-- GEN:stop --> ||||

Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ async def set_checked(
async def add_locator_handler(
self,
locator: "Locator",
handler: Callable,
handler: Union[Callable[["Locator"], Any], Callable[[], Any]],
noWaitAfter: bool = None,
times: int = None,
) -> None:
Expand Down
6 changes: 4 additions & 2 deletions playwright/async_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -11723,7 +11723,9 @@ async def set_checked(
async def add_locator_handler(
self,
locator: "Locator",
handler: typing.Callable,
handler: typing.Union[
typing.Callable[["Locator"], typing.Any], typing.Callable[[], typing.Any]
],
*,
no_wait_after: typing.Optional[bool] = None,
times: typing.Optional[int] = None
Expand Down Expand Up @@ -11818,7 +11820,7 @@ def handler(locator):
----------
locator : Locator
Locator that triggers the handler.
handler : Callable
handler : Union[Callable[[Locator], Any], Callable[[], Any]]
Function that should be run once `locator` appears. This function should get rid of the element that blocks actions
like click.
no_wait_after : Union[bool, None]
Expand Down
6 changes: 4 additions & 2 deletions playwright/sync_api/_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -11808,7 +11808,9 @@ def set_checked(
def add_locator_handler(
self,
locator: "Locator",
handler: typing.Callable,
handler: typing.Union[
typing.Callable[["Locator"], typing.Any], typing.Callable[[], typing.Any]
],
*,
no_wait_after: typing.Optional[bool] = None,
times: typing.Optional[int] = None
Expand Down Expand Up @@ -11903,7 +11905,7 @@ def handler(locator):
----------
locator : Locator
Locator that triggers the handler.
handler : Callable
handler : Union[Callable[[Locator], Any], Callable[[], Any]]
Function that should be run once `locator` appears. This function should get rid of the element that blocks actions
like click.
no_wait_after : Union[bool, None]
Expand Down
3 changes: 2 additions & 1 deletion scripts/expected_api_mismatch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Parameter type mismatch in BrowserContext.unroute(handler=): documented as Union
Parameter type mismatch in Page.route(handler=): documented as Callable[[Route, Request], Union[Any, Any]], code has Union[Callable[[Route, Request], Any], Callable[[Route], Any]]
Parameter type mismatch in Page.unroute(handler=): documented as Union[Callable[[Route, Request], Union[Any, Any]], None], code has Union[Callable[[Route, Request], Any], Callable[[Route], Any], None]

Parameter type mismatch in Page.add_locator_handler(handler=): documented as Callable[[Locator], Any], code has Callable
# One vs two arguments in the callback, Python explicitly unions.
Parameter type mismatch in Page.add_locator_handler(handler=): documented as Callable[[Locator], Any], code has Union[Callable[[Locator], Any], Callable[[], Any]]

0 comments on commit 1572fe7

Please sign in to comment.