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


Groups > comp.lang.python > #84488

Re: Python Sanity Proposal: Type Hinting Solution

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.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.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'tree': 0.05; 'subject:Python': 0.06; 'string': 0.09; 'decorator': 0.09; 'expected.': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'argument,': 0.16; 'ast': 0.16; 'bool': 0.16; 'callable.': 0.16; 'email name:"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'int)': 0.16; 'string:': 0.16; 'syntax,': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'mechanism': 0.19; 'normally': 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'either.': 0.24; 'parse': 0.24; 'paul': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'rest': 0.29; 'am,': 0.29; 'skip:@ 10': 0.30; 'message-id:@mail.gmail.com': 0.30; 'getting': 0.31; '25,': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'writes:': 0.31; 'extend': 0.32; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'module.': 0.36; "didn't": 0.36; 'being': 0.38; 'e.g.': 0.38; 'rather': 0.38; 'extremely': 0.39; 'catch': 0.60; 'hints': 0.68; 'receive': 0.70; '2015': 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=h8kzjRXEkvJTTxHGWJdpqAWCMWZef9TiBIBrnmaGxU4=; b=TkKgb4GHDWgMD8Y84akfyc8GNvodSALTVKpbNkA4CHwLuxNStlldrTLgEgFqvz/ED2 yVfwjCBvwmsGY2YCpvTy0WsXVDJzczRJ9c/TrsId9ggMyGq0Il96BHl1F/K0hP8qfHvk 4+GTI2nEojGV7fDE7c1s/Y/j81YWxGWs0ouRpN2htLRdxL4qnRUP0156lJ+IisU3VF3q MN0jVTGyydT86Ub9LsbA+iTXtQYeNbNEb2TULqGLr0cjnw7EOEqlklFkIxGj8IKEvT7l YTQQbRwjK41pbu3wfBMphuY+dOEvudeIBxI/F9pGPIyocvggxTvS5edTUKdnyrPIg3f0 er9w==
MIME-Version 1.0
X-Received by 10.224.128.196 with SMTP id l4mr27322002qas.100.1422129550773; Sat, 24 Jan 2015 11:59:10 -0800 (PST)
In-Reply-To <87bnlo5bbz.fsf@jester.gateway.sonic.net>
References <6da1eb58-a0bb-4d37-8293-0a8cafe6a89c@googlegroups.com> <m9sep8$p53$1@ger.gmane.org> <mailman.18017.1421985858.18130.python-list@python.org> <5afad59b-5e8c-4821-85cf-9e971c8c7be6@googlegroups.com> <MPG.2f2cd54cf9ff377e98968a@nntp.aioe.org> <4b3b498a-c9b0-443d-8514-87ccd8e98f43@googlegroups.com> <MPG.2f2cecb4624e49c498968c@nntp.aioe.org> <54c39e48$0$12996$c3e8da3$5496439d@news.astraweb.com> <7db16477-1dd6-4f93-adfe-54f7b7a690b2@googlegroups.com> <54c3d5d0$0$12977$c3e8da3$5496439d@news.astraweb.com> <87bnlo5bbz.fsf@jester.gateway.sonic.net>
Date Sun, 25 Jan 2015 06:59:10 +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.18095.1422129558.18130.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1422129558 news.xs4all.nl 2847 [2001:888:2000:d::a6]:45663
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:84488

Show key headers only | View raw


On Sun, Jan 25, 2015 at 4:37 AM, Paul Rubin <no.email@nospam.invalid> wrote:
> Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:
>> versus any other decorator, but the STRING:
>> "@typehint(...)"
>> being used where a decorator would normally be expected.
>
> I didn't catch that either.  I think if hints are to go in decorators,
> then it's best to extend the decorator mechanism to allow arbitrary
> syntax, e.g.
>
> @-typehint (str, int) -> bool
>
> The @- would signify that the typehint function is to receive an AST as
> its argument, rather than its callable.  The AST would be the parse tree
> for the rest of the line.  Alternatively, it could get the line as a
> string and parse it with appropriate functions from the ast module.

That seems extremely messy. Why not use what can already be done?
Since you talk about getting the line as a string...

@typehint("(str, int) -> bool")

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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