Advertisement
lllumineux

function docstring example

Dec 8th, 2020
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1.     async def save(self, fp, *, seek_begin=True, use_cached=False):
  2.         """|coro|
  3.  
  4.        Saves this attachment into a file-like object.
  5.  
  6.        Parameters
  7.        -----------
  8.        fp: Union[:class:`io.BufferedIOBase`, :class:`os.PathLike`]
  9.            The file-like object to save this attachment to or the filename
  10.            to use. If a filename is passed then a file is created with that
  11.            filename and used instead.
  12.        seek_begin: :class:`bool`
  13.            Whether to seek to the beginning of the file after saving is
  14.            successfully done.
  15.        use_cached: :class:`bool`
  16.            Whether to use :attr:`proxy_url` rather than :attr:`url` when downloading
  17.            the attachment. This will allow attachments to be saved after deletion
  18.            more often, compared to the regular URL which is generally deleted right
  19.            after the message is deleted. Note that this can still fail to download
  20.            deleted attachments if too much time has passed and it does not work
  21.            on some types of attachments.
  22.  
  23.        Raises
  24.        --------
  25.        HTTPException
  26.            Saving the attachment failed.
  27.        NotFound
  28.            The attachment was deleted.
  29.  
  30.        Returns
  31.        --------
  32.        :class:`int`
  33.            The number of bytes written.
  34.        """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement