Open
Description
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":
...