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


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

Re: [Python-de] name2type mapping

From Thomas Güttler <guettliml@thomas-guettler.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] name2type mapping
Date 2018-10-29 09:03 +0100
Message-ID <mailman.324.1540800189.2799.python-de@python.org> (permalink)
References <54aef4d4-d183-2974-4374-8a6fc07aa9ad@thomas-guettler.de> <b09292b7-9fe4-a1d6-fef0-5202318222b7@bakera.de> <ad8dfc48-a1e4-9535-6c5f-9ff885384946@thomas-guettler.de> <834820a5-60cd-7997-8a62-2a6cc4aee643@bakera.de> <2c7f3083-e69a-fb80-9f49-aa63b7bd336d@thomas-guettler.de>

Show all headers | View raw



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

Back to de.comp.lang.python | Previous | Next | Find similar


Thread

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

csiph-web