Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]: deprecated methods are not marked as deprecated in the generated python api code #2607

Open
DetachHead opened this issue Oct 22, 2024 · 0 comments

Comments

@DetachHead
Copy link

Page(s)

https://playwright.dev/python/docs/api/class-framelocator#deprecated

Description

the deprecated methods first, last and nth are not marked as such in the python code:

class FrameLocator(SyncBase):

    @property
    def first(self) -> "FrameLocator":
        """FrameLocator.first

        Returns locator to the first matching frame.

        Returns
        -------
        FrameLocator
        """
        return mapping.from_impl(self._impl_obj.first)

    @property
    def last(self) -> "FrameLocator":
        """FrameLocator.last

        Returns locator to the last matching frame.

        Returns
        -------
        FrameLocator
        """
        return mapping.from_impl(self._impl_obj.last)

it should use the typing_extensions.deprecated decorator to mark the function as deprecated, so that it warns the user in their IDE:

from typing_extensions import deprecated

class FrameLocator(SyncBase):

    @property
    @deprecated("Use `locator.first` followed by `locator.content_frame` instead.")
    def first(self) -> "FrameLocator":
        ...

Image

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

No branches or pull requests

1 participant