Skip to content

Commit 391a449

Browse files
committed
revert changes to page.py
1 parent cf7de8d commit 391a449

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

web_poet/pages.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import abc
22
import attr
3-
from typing import Any, Optional
3+
import typing
44

55
from web_poet.mixins import ResponseShortcutsMixin
66
from web_poet.page_inputs import ResponseData
7-
from web_poet.requests import HttpClient
87

98

109
class Injectable(abc.ABC):
@@ -27,13 +26,12 @@ class Injectable(abc.ABC):
2726
Injectable.register(type(None))
2827

2928

30-
def is_injectable(cls: Any) -> bool:
29+
def is_injectable(cls: typing.Any) -> bool:
3130
"""Return True if ``cls`` is a class which inherits
3231
from :class:`~.Injectable`."""
3332
return isinstance(cls, type) and issubclass(cls, Injectable)
3433

3534

36-
@attr.define
3735
class ItemPage(Injectable, abc.ABC):
3836
"""Base Page Object with a required :meth:`to_item` method.
3937
Make sure you're creating Page Objects with ``to_item`` methods
@@ -45,7 +43,7 @@ def to_item(self):
4543
"""Extract an item from a web page"""
4644

4745

48-
@attr.define
46+
@attr.s(auto_attribs=True)
4947
class WebPage(Injectable, ResponseShortcutsMixin):
5048
"""Base Page Object which requires :class:`~.ResponseData`
5149
and provides XPath / CSS shortcuts.
@@ -56,9 +54,9 @@ class WebPage(Injectable, ResponseShortcutsMixin):
5654
response: ResponseData
5755

5856

59-
@attr.define
57+
@attr.s(auto_attribs=True)
6058
class ItemWebPage(WebPage, ItemPage):
6159
""":class:`WebPage` that requires the :meth:`to_item` method to
6260
be implemented.
6361
"""
64-
http_client: Optional[HttpClient]
62+
pass

0 commit comments

Comments
 (0)