From 35adc1076da25cab98858bbab8fb051e3c679863 Mon Sep 17 00:00:00 2001 From: Faholan <62927863+Faholan@users.noreply.github.com> Date: Tue, 27 Apr 2021 17:30:19 +0200 Subject: [PATCH 1/2] Add typehints to File class --- discord-stubs/file.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discord-stubs/file.pyi b/discord-stubs/file.pyi index bc1dfe2..6825b28 100644 --- a/discord-stubs/file.pyi +++ b/discord-stubs/file.pyi @@ -1,12 +1,13 @@ from typing import BinaryIO, Optional, Union +from io import BytesIO, StringIO class File: - fp: Union[str, BinaryIO] + fp: Union[str, BinaryIO, BytesIO, StringIO] filename: Optional[str] spoiler: bool def __init__( self, - fp: Union[str, BinaryIO], + fp: Union[str, BinaryIO, BytesIO, StringIO], filename: Optional[str] = ..., *, spoiler: bool = ..., From 3247e2d8f2c8d21545756941424289ef9d789df1 Mon Sep 17 00:00:00 2001 From: Faholan <62927863+Faholan@users.noreply.github.com> Date: Mon, 10 May 2021 19:02:21 +0200 Subject: [PATCH 2/2] Fix import order (isort) --- discord-stubs/file.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord-stubs/file.pyi b/discord-stubs/file.pyi index 6825b28..9dbb121 100644 --- a/discord-stubs/file.pyi +++ b/discord-stubs/file.pyi @@ -1,5 +1,5 @@ -from typing import BinaryIO, Optional, Union from io import BytesIO, StringIO +from typing import BinaryIO, Optional, Union class File: fp: Union[str, BinaryIO, BytesIO, StringIO]