Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5304 > unrolled thread

Re: [Python-de] name2type mapping

Started byThomas Güttler <guettliml@thomas-guettler.de>
First post2018-10-29 09:03 +0100
Last post2018-10-29 09:03 +0100
Articles 1 — 1 participant

Back to article view | Back to de.comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [Python-de] name2type mapping Thomas Güttler <guettliml@thomas-guettler.de> - 2018-10-29 09:03 +0100

#5304 — Re: [Python-de] name2type mapping

FromThomas Güttler <guettliml@thomas-guettler.de>
Date2018-10-29 09:03 +0100
SubjectRe: [Python-de] name2type mapping
Message-ID<mailman.324.1540800189.2799.python-de@python.org>

Am 26.10.18 um 15:45 schrieb Marco Bakera:
> Thomas Güttler schrieb am 26.10.18 um 14:23:
>>
>>
>> Am 26.10.18 um 13:05 schrieb Marco Bakera:
>>>
>>> Mich würden drei Dinge interessieren:
>>>
>>> 1. Welches Problem wird gelöst?
>>
>> Obige URL zeigt einen englischen Text der wenige Wörter lang ist.
>> Was ist an "Better type-hints in IDEs." unverständlich?
> 
> Den Text hatte ich gelesen. "Better type-hints" beschreibt aber kein
> Problem, das gelöst werden soll und klang für meinen Geschmack zu
> generisch. In welcher Hinsicht soll denn etwas verbessert werden? Was
> fehlt bei den derzeitigen Type-Hints? Und wurde dieser Aspekt beim
> Entstehen von PEP 484 bereits diskutiert?

Ich habe mal ein Beispiel hinzugefügt:

https://github.com/guettli/python-name2type-mapping/#use-case-example

{{{
Use Case Example

Your code base contains a variable name "request" 100 times, and in 70 times the variable type is an instance of 
"django.http.HttpRequest" (detected by usual type annotations). If you want to have valid type information of all 
occurences of "request" in your code, then you need to find a solution for 30 usages. You could annotate the variable in 
your code 30 times (once per method). Or you could define a name2type mapping in the __init__.py file if your code.

}}}

Was ist nun noch unklar?

Gruß,
   Thomas



-- 
Thomas Guettler http://www.thomas-guettler.de/
I am looking for feedback: https://github.com/guettli/programming-guidelines

[toc] | [standalone]


Back to top | Article view | de.comp.lang.python


csiph-web