Skip to content

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

Open
@DetachHead

Description

@DetachHead

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions