Spaces:
Running
Running
File size: 756 Bytes
3fe0726 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
class News:
"""
Class representing a news item.
"""
def __init__(self, id=None, headline=None, summary=None, author=None,
created_at=None, updated_at=None, url=None,
content=None, symbols=None, source=None, title=None):
self.id = id
self.headline = headline or title
self.title = title or headline
self.summary = summary
self.author = author
self.created_at = created_at
self.updated_at = updated_at
self.url = url
self.content = content
self.symbols = symbols or []
self.source = source
def __repr__(self):
return f"News(headline='{self.headline}', source='{self.source}', symbols={self.symbols})"
|