Conversation
|
|
||
|
|
||
| class Request(HTTPConnection): | ||
| class Request(HTTPConnection[StateT]): |
There was a problem hiding this comment.
We are missing the same in WebSockets.
| strategy: | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
There was a problem hiding this comment.
Just so the pipeline can pass, but we shouldn't merge this here.
|
@alex-oleshkevich @abersheeran Can you check this, please? |
All good. |
In the sense that this implementation makes sense, or something different? 🤔 |
We want to have a typed request state and keep backward compatibility. That was achieved, so all is good :) |
|
This was exactly what I had in mind :D thanks @Kludex! |
|
|
||
|
|
||
| class HTTPConnection(Mapping[str, Any]): | ||
| StateT = TypeVar("StateT", bound=Mapping[str, Any] | State, default=State) |
There was a problem hiding this comment.
I'm not sure if this will pass the TypedDict check in some static type checkers.
There was a problem hiding this comment.
Which one you don't think it will not? We test with mypy here, but pyright doesn't seem to be failing (I use it on my environment).
There was a problem hiding this comment.
It's great to be able to pass the inspection.
|
Hi there! 👋 |
adriangb
left a comment
There was a problem hiding this comment.
Can you add some tests? Some example usage in docstrings? Updated docs that show what users can achieve now, why the new patterns are better, etc.?
Co-authored-by: PerumallaGiridhar <145003734+PerumallaGiridhar@users.noreply.github.com>
I've added documentation, and tests, but I believe most of background for this is in the issue that motivated this PR: #3005 |
Uh oh!
There was an error while loading. Please reload this page.