Is your feature request related to a problem? Please describe.
Proper typing on return type of methods
from uplink import Consumer, post
class Client(Consumer):
@post("example")
def example_method(self) -> list[int]:
pass
a = Client().example_method
you can verify the return type with mypy with one single command:
uv run --python 3.12 --with 'uplink[aiohttp]>=0.10.0' --with mypy mypy --python-version 3.12 --ignore-missing-imports --disable-error-code empty-body -c $'from uplink import Consumer, post\n\nclass Client(Consumer):\n @post("example")\n def example_method(self) -> list[int]: ...\n\na = Client().example_method\nreveal_type(a)'
yes, this iwas generated by AI, but that just run python 3.12 with uplink[aiohttp]>=0.10.0' and mypy (latest) and verify the return of the var a on the previous code snippet
<string>:8: note: Revealed type is "Any"
Success: no issues found in 1 source file
it's Any, not list[int] as expected.
Describe the solution you'd like
I honestly don't know. This is open to discussion
This lib is kind of abandoned, so I'm not sure if a refactor is worth it.
OtOH, I asked AI to one shot type stubs and it came up with this
https://github.com/danielpassy/uplink-stubs
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
Proper typing on return type of methods
you can verify the return type with mypy with one single command:
yes, this iwas generated by AI, but that just run python 3.12 with uplink[aiohttp]>=0.10.0' and mypy (latest) and verify the return of the var
aon the previous code snippetit's
Any, notlist[int]as expected.Describe the solution you'd like
I honestly don't know. This is open to discussion
This lib is kind of abandoned, so I'm not sure if a refactor is worth it.
OtOH, I asked AI to one shot type stubs and it came up with this
https://github.com/danielpassy/uplink-stubs
Additional context
Add any other context or screenshots about the feature request here.