Skip to content

Improve type hints on File#111

Merged
Kludex merged 1 commit intomasterfrom
keep-improving-type-hints
Feb 12, 2024
Merged

Improve type hints on File#111
Kludex merged 1 commit intomasterfrom
keep-improving-type-hints

Conversation

@Kludex
Copy link
Owner

@Kludex Kludex commented Feb 12, 2024

No description provided.


class FileConfig(TypedDict, total=False):
UPLOAD_DIR: str | None
UPLOAD_DIR: str | bytes | None
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to think about this, but for now this is the most correct.

old_fileobj.close()

def _get_disk_file(self):
def _get_disk_file(self) -> io.BufferedRandom | tempfile._TemporaryFileWrapper[bytes]: # type: ignore[reportPrivateUsage]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most correct for now...

@Kludex Kludex changed the title Keep improving type hints Improve type hints Feb 12, 2024
@Kludex Kludex changed the title Improve type hints Improve type hints on File Feb 12, 2024
@Kludex Kludex merged commit f4479c6 into master Feb 12, 2024
@Kludex Kludex deleted the keep-improving-type-hints branch February 12, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant