Skip to content

chore(codegen): type _impl_obj in the generated API - #3241

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:codegen-typed-impl
Oct 12, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:codegen-typed-impl

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Each generated class declares the type of its _impl_obj, so mypy playwright checks every generated call against playwright/_impl: a member or option that the docs have and _impl/ lacks is a mypy error.
  • Calls that return nothing lose the mapping.from_maybe_impl() wrapper; _wrap_handler and to_milliseconds get matching annotations; test_browser_type_repr uses the public browser.browser_type.

- Each generated class declares the type of its _impl_obj, so mypy checks
  every generated call against playwright/_impl: a member or option that
  the docs have and _impl/ lacks is now a mypy error.
- Calls that return nothing are no longer wrapped in
  mapping.from_maybe_impl(), which mypy rejects once the type is known.
- _wrap_handler returns Any and to_milliseconds gets overloads, to match
  the generated calls.
- test_browser_type_repr uses the public browser.browser_type.
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 222a2e0 into microsoft:main Oct 12, 2026
28 of 29 checks passed
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.

2 participants