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


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

Re: [Python-de] name2type mapping

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Thomas Güttler <guettliml@thomas-guettler.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] name2type mapping
Date Mon, 29 Oct 2018 09:03:01 +0100
Lines 45
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>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de P2jksk3r0RteQhzMWSGYrQ5ZtLuW3lzg+sdG3o7bzYrg==
Return-Path <guettliml@thomas-guettler.de>
X-Original-To python-de@python.org
Delivered-To python-de@mail.python.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1
In-Reply-To <834820a5-60cd-7997-8a62-2a6cc4aee643@bakera.de>
Content-Language de-DE
X-BeenThere python-de@python.org
X-Mailman-Version 2.1.29
Precedence list
List-Id Die Deutsche Python Mailingliste <python-de.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-de/>
List-Post <mailto:python-de@python.org>
List-Help <mailto:python-de-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <2c7f3083-e69a-fb80-9f49-aa63b7bd336d@thomas-guettler.de>
X-Mailman-Original-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>
Xref csiph.com de.comp.lang.python:5304

Show key headers only | 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