Skip to content

Commit ec78650

Browse files
committed
make private attr, private
1 parent 6665287 commit ec78650

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mystbin/objects.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class PasteData:
8989
The syntax you specified that this Paste is in.
9090
paste_nick: Optional[:class:`str`]
9191
The nick set for this paste on the API.
92-
paste_date: :class:`str`
93-
The date this paste was created on the API.
9492
"""
9593

9694
__slots__ = (
@@ -99,7 +97,7 @@ class PasteData:
9997
"paste_content",
10098
"paste_syntax",
10199
"paste_nick",
102-
"paste_date",
100+
"_created_at",
103101
)
104102

105103
def __init__(self, paste_id: str, paste_data: dict[str, Any]):
@@ -108,13 +106,13 @@ def __init__(self, paste_id: str, paste_data: dict[str, Any]):
108106
self.paste_content: str = paste_data["data"]
109107
self.paste_syntax: str = paste_data["syntax"]
110108
self.paste_nick: Optional[str] = paste_data["nick"]
111-
self.paste_date: str = paste_data["created_at"]
109+
self._created_at: str = paste_data["created_at"]
112110

113111
def __str__(self) -> str:
114112
return self.content
115113

116114
def __repr__(self) -> str:
117-
return f"<PasteData id={self.paste_id} nick={self.paste_nick} syntax={self.paste_syntax}>"
115+
return f"<PasteData id={self.paste_id!r} nick={self.paste_nick!r} syntax={self.paste_syntax!r}>"
118116

119117
@property
120118
def url(self) -> str:
@@ -125,7 +123,7 @@ def url(self) -> str:
125123
@property
126124
def created_at(self) -> datetime.datetime:
127125
""":class:`datetime.datetime`: Returns a UTC datetime of when the paste was created."""
128-
return datetime.datetime.strptime(self.paste_date, "%Y-%m-%dT%H:%M:%S.%f")
126+
return datetime.datetime.strptime(self._created_at, "%Y-%m-%dT%H:%M:%S.%f")
129127

130128
@property
131129
def content(self) -> str:

0 commit comments

Comments
 (0)