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


Groups > comp.lang.python > #84317

Re: Python Sanity Proposal: Type Hinting Solution

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.064
X-Spam-Evidence '*H*': 0.87; '*S*': 0.00; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'thread': 0.14; '10:59': 0.16; '23,': 0.16; 'brilliant': 0.16; 'doctests': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reedy': 0.16; 'sync': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'file,': 0.19; 'unlike': 0.19; '>>>': 0.22; 'putting': 0.22; 'separate': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'file.': 0.24; 'cc:2**0': 0.24; 'options': 0.25; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'related': 0.29; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'stated.': 0.31; 'option': 0.32; 'another': 0.32; 'fri,': 0.33; 'could': 0.34; 'tool': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'two': 0.37; 'files': 0.38; 'pm,': 0.38; 'short': 0.38; 'does': 0.39; 'called': 0.40; 'cost.': 0.60; 'most': 0.60; 'break': 0.61; 'new': 0.61; 'costs': 0.63; 'worth': 0.66; 'hints': 0.68; 'line,': 0.68; 'real-world': 0.68; 'us,': 0.73; '2015': 0.84; 'compact,': 0.84; "everything's": 0.84; 'proposal.': 0.84; 'subject:Solution': 0.84; 'subject:Proposal': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=WQ/4IyrVM1My5r/6fd/W8xZAEx0u0NCtwKLtyfeIvj4=; b=g7+0YTTQkbPQyXIGcLJBnkitoIYAVi7RjiiBtQyhrf7A0XQBBwnYCBnpAhAaXN5lqz tLmai2G4T8GY9pQgCRh0YwX7AfGOLUoMWAWaUgQ9J50WHOzrkslJd7+U9ynJx9JzQacP T01/Nju59cIp+sXxIweiG4+y88Kc7nLjYovsZf9v9PQ2PO+rQIJoW8qszadOhfDBG4QK fRcQz38UzWMg77zDLx6AorEYBwYVlWO6h/JEFR3fHm6RmIcGFsnwPK/ShvcJKQnxdrCQ UkjC22YEbC8a0BSo3GXAefYKukF0tnUGW8ap1wOE/rkhmxHFwg1LZMcUQEReNBKXV7Lk kpvA==
MIME-Version 1.0
X-Received by 10.224.128.196 with SMTP id l4mr10765716qas.100.1421991116062; Thu, 22 Jan 2015 21:31:56 -0800 (PST)
In-Reply-To <m9skn0$dok$1@ger.gmane.org>
References <6da1eb58-a0bb-4d37-8293-0a8cafe6a89c@googlegroups.com> <m9sep8$p53$1@ger.gmane.org> <CAPTjJmqXLWEkz-KzxWWD4KRkHs4cdC3Z0DKZ8otjqTkytydsmQ@mail.gmail.com> <m9skn0$dok$1@ger.gmane.org>
Date Fri, 23 Jan 2015 16:31:55 +1100
Subject Re: Python Sanity Proposal: Type Hinting Solution
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.18019.1421991118.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421991118 news.xs4all.nl 2889 [2001:888:2000:d::a6]:34541
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84317

Show key headers only | View raw


On Fri, Jan 23, 2015 at 4:03 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> On 1/22/2015 10:59 PM, Chris Angelico wrote:
>>
>> On Fri, Jan 23, 2015 at 2:22 PM, Terry Reedy <tjreedy@udel.edu> wrote:
>>>
>>> This idea is so brilliant that it is already an option in mypy and is
>>> part
>>> of the new type-hint proposal.  The separate type-hint files are called
>>> 'stub files'.
>>
>>
>> It's worth pointing out, too, that the idea isn't panaceaic - it's
>> just another tool in the box. Any time you break related things into
>> separate places, especially separate files, the tendency for them to
>> get out of sync grows dramatically.
>
>
> The same could be said of putting tests in a separate file.

Yep. It's not a killer, but it does have a cost. That's one reason for
doctests - to put the tests in with the code. Everything's a
trade-off; with tests it's often better to put them in another file,
but type hints are short and compact, and can be briefly stated.
Unlike the complicated ones this thread has given us, most real-world
ones will be short. So we have the option to put them in-line or out
of line, and the two options have competing costs (readability vs code
disconnect).

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-22 17:15 -0800
  Re: Python Sanity Proposal: Type Hinting Solution MRAB <python@mrabarnett.plus.com> - 2015-01-23 03:22 +0000
  Re: Python Sanity Proposal: Type Hinting Solution Terry Reedy <tjreedy@udel.edu> - 2015-01-22 22:22 -0500
    Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 11:23 -0800
      Re: Python Sanity Proposal: Type Hinting Solution Christian Gollwitzer <auriocus@gmx.de> - 2015-01-24 22:14 +0100
  Re: Python Sanity Proposal: Type Hinting Solution Rustom Mody <rustompmody@gmail.com> - 2015-01-22 19:23 -0800
    Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 11:36 -0800
  Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-23 14:59 +1100
    Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 11:48 -0800
      Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-24 06:59 +1100
        Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 12:59 -0800
      Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-23 22:02 +0100
        Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 13:59 -0800
          Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-23 23:42 +0100
            Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-23 23:45 +0100
              Re: Python Sanity Proposal: Type Hinting Solution sohcahtoa82@gmail.com - 2015-01-23 14:52 -0800
                Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-24 00:14 +0100
              Re: Python Sanity Proposal: Type Hinting Solution Marko Rauhamaa <marko@pacujo.net> - 2015-01-24 01:52 +0200
                Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-24 16:29 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-24 16:38 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-24 17:36 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-24 17:47 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Marko Rauhamaa <marko@pacujo.net> - 2015-01-24 11:27 +0200
            Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 15:39 -0800
            Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-25 00:29 +1100
              Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-24 15:09 +0100
                Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-24 15:32 +0100
                Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-25 03:05 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Marco Buttu <marco.buttu@gmail.com> - 2015-01-24 15:25 +0100
              Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-24 08:41 -0800
                Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-25 04:26 +1100
                Re: Python Sanity Proposal: Type Hinting Solution Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-01-24 17:36 +0000
                Re: Python Sanity Proposal: Type Hinting Solution Paul Rubin <no.email@nospam.invalid> - 2015-01-24 09:37 -0800
                Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-25 06:59 +1100
  Re: Python Sanity Proposal: Type Hinting Solution Terry Reedy <tjreedy@udel.edu> - 2015-01-23 00:03 -0500
    Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-23 16:59 +1100
      Re: Python Sanity Proposal: Type Hinting Solution "Fetchinson ." <fetchinson@googlemail.com> - 2015-01-23 14:23 +0100
        Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 12:21 -0800
          Re: Python Sanity Proposal: Type Hinting Solution Mario Figueiredo <marfig@gmail.com> - 2015-01-23 22:12 +0100
            Re: Python Sanity Proposal: Type Hinting Solution Rick Johnson <rantingrickjohnson@gmail.com> - 2015-01-23 14:26 -0800
        Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-24 17:21 +1100
          Re: Python Sanity Proposal: Type Hinting Solution Tim Chase <python.list@tim.thechases.com> - 2015-01-24 06:47 -0600
            Re: Python Sanity Proposal: Type Hinting Solution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-25 00:40 +1100
              Re: Python Sanity Proposal: Type Hinting Solution Roy Smith <roy@panix.com> - 2015-01-24 09:06 -0500
          Re: Python Sanity Proposal: Type Hinting Solution "Fetchinson ." <fetchinson@googlemail.com> - 2015-01-24 22:01 +0100
      Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-24 04:11 +1100
      Re: Python Sanity Proposal: Type Hinting Solution "Fetchinson ." <fetchinson@googlemail.com> - 2015-01-23 22:07 +0100
  Re: Python Sanity Proposal: Type Hinting Solution Chris Angelico <rosuav@gmail.com> - 2015-01-23 16:31 +1100

csiph-web