Skip to content

Conversation

@DeflateAwning
Copy link
Contributor

Motivation

Related to #518. Not a complete fix, but makes some progress.

Tests

CI should really get upgraded and have ruff for checking and pyright for type validations.

Copy link
Collaborator

@ddelange ddelange left a comment

Choose a reason for hiding this comment

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

CI should really get upgraded and have ruff for checking and pyright for type validations

I would love an astral stack upgrade! They also built a type checker that I expect will supercede mypy/pyright over time: https://github.com/astral-sh/ty

Overall it would be great to have some CI to cover this PR before merging.

Big bonus would be to differentiate r/w/a return types (see docstring I mentioned in the issue, although I don't know a project that has implemented this properly).

encoding: None = ...,
errors: None = ...,
newline: None = ...,
closefd: bool = ...,
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't all these be omitted? ie the overloads only contain uri and mode? also the type hints here (None) are differing from below

compression: str = ...,
transport_params: dict[str, Any] | None = ...,
) -> TextIO: ...
@overload
Copy link
Collaborator

Choose a reason for hiding this comment

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

2 newlines?

errors: str | None = None,
newline: str | None = None,
closefd: bool = True,
opener: object | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

closefd and opener are completely ignored, not even propagated to _shortcut_open

client: object | None = None,
client_kwargs: dict | None = None,
writebuffer: IO[bytes] | None = None,
) -> BinaryIO:
Copy link
Collaborator

Choose a reason for hiding this comment

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

why IO[bytes] and not BinaryIO for writebuffer?

@ddelange
Copy link
Collaborator

first step towards uv in #890

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.

2 participants