Imaging you are developing in the django context.
Everytime you use a variable named "request" or "response" your human brains
knows that this is a subclass of django.http.HttpRequest and
django.http.HttpResponse.
How to give the IDE this knowledge?
One solution is the do typehinting everywhe
> On 19 Oct 2018, at 09:18, Thomas Güttler wrote:
>
> Imaging you are developing in the django context.
>
> Everytime you use a variable named "request" or "response" your human brains
> knows that this is a subclass of django.http.HttpRequest and
> django.http.HttpResponse.
>
> How to give
That would be a feature in my "python dialect" future library. Taking one
valid python program and producing another python program :
def f(request):
return HttpResponse('ok')
→
def f(request: HttpRequest):
return HttpResponse('ok')
The dialect options would include "all top functions in
Am 19.10.18 um 10:22 schrieb Robert Vanden Eynde:
That would be a feature in my "python dialect" future library. Taking one valid python program and producing another
python program :
def f(request):
return HttpResponse('ok')
→
def f(request: HttpRequest):
return HttpResponse('ok')
Th
On Fri, 19 Oct 2018 at 08:19, Thomas Güttler
wrote:
> [...]
> This makes the type mapping available for all files in this directory (or
> sub-directories).
> What do you think?
>
I don't think this should be a language feature. _Maybe_ it can be some
kind of an agreed format between IDEs.
But in
e is a different mapping. Then "response" means
> > type requests.Response.
> >
> >
> > Now my idea: Per module and/or per file type hinting from variable name.
> >
> > Maybe a magic docstring in the __init__.py file:
> >
> > """
> &g
Am 19.10.18 um 11:42 schrieb Ivan Levkivskyi:
On Fri, 19 Oct 2018 at 08:19, Thomas Güttler mailto:[email protected]>> wrote:
[...]
This makes the type mapping available for all files in this directory (or
sub-directories).
What do you think?
I don't think this should
On Fri, Oct 19, 2018 at 09:18:02AM +0200, Thomas Güttler wrote:
> Imaging you are developing in the django context.
>
> Everytime you use a variable named "request" or "response" your human brains
> knows that this is a subclass of django.http.HttpRequest and
> django.http.HttpResponse.
Not *my
> On 19 Oct 2018, at 12:15, Steven D'Aprano wrote:
>
> On Fri, Oct 19, 2018 at 09:18:02AM +0200, Thomas Güttler wrote:
>
>> Imaging you are developing in the django context.
>>
>> Everytime you use a variable named "request" or "response" your human brains
>> knows that this is a subclass of
Related:
https://github.com/python/mypy/issues/2103
- Elazar
On Fri, Oct 19, 2018 at 2:15 PM Anders Hovmöller
wrote:
>
>
> > On 19 Oct 2018, at 12:15, Steven D'Aprano wrote:
> >
> > On Fri, Oct 19, 2018 at 09:18:02AM +0200, Thomas Güttler wrote:
> >
> >> Imaging you are developing in the djang
10 matches
Mail list logo