Repository navigation
Conversation
Without these, type inference would be required, the output of which can differ between type checkers. Explict fields also serves as documentation and can be a place to add explicit field descriptions in future.
This reverts commit 1501725.
|
So, I'm less convinced about this one...
Personally my suggestion would be that we punt on any |
|
Fair enough, happy to pause for now |
That could be
|
|
I was thinking about what sorts of changes can happen and what would get caught or not. 1. New field added toA new parameter is added to 2. Type of field changed in
|
| app: typing.Callable[..., typing.Any] | ||
| raise_app_exceptions: bool | ||
| script_name: str | ||
| remote_addr: str | ||
| wsgi_errors: typing.Optional[typing.TextIO] |
There was a problem hiding this comment.
We don't really want these to be public API.
The HTTPTransport class has it's implementation attributes use a private namespace, but the WSGITransport and ASGITransport classes currently don't.
| jar: CookieJar | ||
|
|
There was a problem hiding this comment.
Hrm. Restructuring __init__ would probably stop this being ambiguous to pyright.
The __init__ method should probably start with self.jar = CookieJar() before the branching cases. That'd seem easier to reason about from my perspective, as well as from pyright's.
| method: str | ||
| url: URL | ||
| headers: Headers | ||
| extensions: RequestExtensions | ||
| stream: typing.Union[SyncByteStream, AsyncByteStream] |
There was a problem hiding this comment.
Which of these are ambiguous to pyright? Some? All?
| status_code: int | ||
| headers: Headers | ||
| next_request: typing.Optional[Request] | ||
| extensions: ResponseExtensions | ||
| history: typing.List["Response"] | ||
| is_closed: bool | ||
| is_stream_consumed: bool | ||
| default_encoding: typing.Union[str, typing.Callable[[bytes], str]] | ||
| stream: typing.Union[SyncByteStream, AsyncByteStream] |
There was a problem hiding this comment.
Which of these are ambiguous to pyright?
|
If y'all are keen on having |
|
Going to close this off as stale. |
Without these, type inference would be required, the output of which can differ between type checkers. Explict fields also serves as documentation and can be a place to add explicit field descriptions in future.
pyright reports:
after.txt
before.txt