Skip to content

Commit cf509bf

Browse files
committed
document raw paste
1 parent 291670a commit cf509bf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mystbin/client.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from __future__ import annotations
2424

2525
import datetime
26-
from typing import List, Literal, Optional, Sequence, overload
26+
from typing import List, Literal, Optional, Sequence, Union, overload
2727

2828
import aiohttp
2929

@@ -182,7 +182,9 @@ async def get_paste(self, paste_id: str, *, password: Optional[str] = ..., raw:
182182
async def get_paste(self, paste_id: str, *, password: Optional[str] = ..., raw: Literal[True]) -> list[str]:
183183
...
184184

185-
async def get_paste(self, paste_id: str, *, password: Optional[str] = None, raw: bool = False) -> Paste | list[str]:
185+
async def get_paste(
186+
self, paste_id: str, *, password: Optional[str] = None, raw: bool = False
187+
) -> Union[Paste, list[str]]:
186188
"""|coro|
187189
188190
Fetch a paste.
@@ -193,6 +195,14 @@ async def get_paste(self, paste_id: str, *, password: Optional[str] = None, raw:
193195
The paste id to fetch.
194196
password: Optional[:class:`str`]
195197
The password of the paste, if any.
198+
raw: :class:`bool`
199+
Whether to return the raw file(s) content or a :class:`~mystbin.Paste` instance.
200+
Defaults to ``False``.
201+
202+
Returns
203+
--------
204+
Union[:class:`~mystbin.Paste`, List[:class:`str`]]
205+
The paste data returned.
196206
"""
197207
data = await self.http.get_paste(paste_id=paste_id, password=password)
198208
if raw:

0 commit comments

Comments
 (0)