Revert "reddit: specify attributes on all protocols"

This reverts commit 995554cea9.
This commit is contained in:
Sean Breckenridge 2021-10-31 14:04:19 -07:00
parent 995554cea9
commit 2f17480add

View file

@ -34,67 +34,24 @@ class RedditBase(Protocol):
def text(self) -> str: ...
# TODO: is there some way to handle this with subclasses or inhering protocols?
# can't seem to figure it out
# Note: doesn't include GDPR Save's since they don't have the same metadata
class Save(Protocol):
@property
def raw(self) -> Json: ...
@property
def created(self) -> datetime_aware: ...
@property
def id(self) -> str: ...
@property
def url(self) -> str: ...
@property
def text(self) -> str: ...
class Save(Protocol, RedditBase):
@property
def subreddit(self) -> str: ...
# Note: doesn't include GDPR Upvote's since they don't have the same metadata
class Upvote(Protocol):
@property
def raw(self) -> Json: ...
@property
def created(self) -> datetime_aware: ...
@property
def id(self) -> str: ...
@property
def url(self) -> str: ...
@property
def text(self) -> str: ...
class Upvote(Protocol, RedditBase):
@property
def title(self) -> str: ...
# From rexport, pushshift and the reddit GDPR export
class Comment(Protocol):
@property
def raw(self) -> Json: ...
@property
def created(self) -> datetime_aware: ...
@property
def id(self) -> str: ...
@property
def url(self) -> str: ...
@property
def text(self) -> str: ...
class Comment(Protocol, RedditBase):
pass
# From rexport and the GDPR export
class Submission(Protocol):
@property
def raw(self) -> Json: ...
@property
def created(self) -> datetime_aware: ...
@property
def id(self) -> str: ...
@property
def url(self) -> str: ...
@property
def text(self) -> str: ...
class Submission(Protocol, RedditBase):
@property
def title(self) -> str: ...