-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.py
31 lines (23 loc) · 838 Bytes
/
video.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""A video class."""
from typing import Sequence
class Video:
"""A class used to represent a Video."""
def __init__(self, video_title: str, video_id: str, video_tags: Sequence[str]):
"""Video constructor."""
self._title = video_title
self._video_id = video_id
# Turn the tags into a tuple here so it's unmodifiable,
# in case the caller changes the 'video_tags' they passed to us
self._tags = tuple(video_tags)
@property
def title(self) -> str:
"""Returns the title of a video."""
return self._title
@property
def video_id(self) -> str:
"""Returns the video id of a video."""
return self._video_id
@property
def tags(self) -> Sequence[str]:
"""Returns the list of tags of a video."""
return self._tags