Skip to content

fix(handlers): support immutable and built-in callbacks - #3344

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
mainfrom
triage/3340/43474010655-1
Nov 13, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
mainfrom
triage/3340/43474010655-1

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor
  • Cache handler wrappers without writing attributes to user callables. Weak values release unused wrappers; identity-based keys support repeated bound-method lookups without retaining receivers or requiring hashable callables.
  • Pass the supplied arguments to native callables that have no inspectable signature, such as set.add and set.__contains__. Other signature errors still propagate.
  • Extend the existing sync console test to check built-in listeners, public wrapper objects, removal, and once.

Verified on Windows with Chromium, Firefox, and WebKit: 340 sync tests and 295 async tests passed, with existing skips and upstream xfails. Independent checks cover slotted/frozen handlers and native route predicates in both APIs. The pinned mypy and pyright pass with Linux platform definitions; their default Windows checks report existing POSIX-only API errors. Serial flake8, the remaining pre-commit hooks, generation consistency, and the test registry check passed.

Fixes #3340

Triaged on Windows by the Playwright bot - agent run

Fixes: #3340

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pavelfeldman
Pavel Feldman (pavelfeldman) marked this pull request as ready for review November 13, 2026 18:49
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit dbf7807 into main Nov 13, 2026
33 of 34 checks passed
@pavelfeldman
Pavel Feldman (pavelfeldman) deleted the triage/3340/43474010655-1 branch November 13, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AttributeError when registering built-in callables, __slots__, or frozen objects as handlers

1 participant