Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Terry Reedy
On 4/21/2015 6:41 PM, Chris Barker wrote: Well, it'll catch passing in a string instead of a sequence of strings -- one of teh common and semi-insidious type errors I see a lot (at least with newbies). Oh wait, maybe it won't -- a string IS a sequence of strings. That's why this is an insidioou

Re: [Python-Dev] async/await in Python; v2

2015-04-21 Thread Greg Ewing
Yury Selivanov wrote: 1. CO_ASYNC flag was renamed to CO_COROUTINE; 2. sys.set_async_wrapper() was renamed to sys.set_coroutine_wrapper(); 3. New function: sys.get_coroutine_wrapper(); 4. types.async_def() renamed to types.coroutine(); I still don't like the idea of hijacking the generic

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Terry Reedy
On 4/21/2015 6:50 PM, Chris Barker wrote: On Tue, Apr 21, 2015 at 11:58 AM, Paul Sokolovsky mailto:pmis...@gmail.com>> wrote: It does, and hope people won't be caught in "static typechecking" loop and consider other usages too. I an interested is using type hints for automatic or at le

Re: [Python-Dev] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Donald Stufft
> On Apr 21, 2015, at 11:35 PM, Gregory P. Smith wrote: > > > > On Tue, Apr 21, 2015 at 10:55 AM Donald Stufft > wrote: > Just thought I'd share this since it shows how what people are using to > download things from PyPI have changed over the past year. Of particular

Re: [Python-Dev] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Gregory P. Smith
On Tue, Apr 21, 2015 at 10:55 AM Donald Stufft wrote: > Just thought I'd share this since it shows how what people are using to > download things from PyPI have changed over the past year. Of particular > interest to most people will be the final graphs showing what percentage of > downloads from

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Robert Collins
On 22 April 2015 at 08:26, Guido van Rossum wrote: > In the end this should be up to you and the reviewers, but for such a > venerable module like unittest I'd be hesitant to be an early adopter. I'd > also expect that much of unittest is too dynamic in nature to benefit from > type hints. But ma

Re: [Python-Dev] Tracker user registration problem

2015-04-21 Thread Shiyao Ma
ITSM for gmail accounts, the activation mail is always in the spam folder. > > -- 吾輩は猫である。ホームーページはhttp://introo.me。 ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.pytho

Re: [Python-Dev] async/await in Python; v2

2015-04-21 Thread Yury Selivanov
Hi Damien, Thanks for noticing! I pushed a fix to the peps repo. Thanks, Yury On 2015-04-21 5:20 PM, Damien George wrote: Hi Yury, In your PEP 492 draft, in the Grammar section, I think you're missing the modifications to the "flow_stmt" line. Cheers, Damien. ___

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Steve Dower
Donald Stufft wrote: > Is this version statically linked by any chance? No, there's no change to the compilation process, so you can get exactly the same result by using the regular installer and copying the files around. Not sure if this is what you're referring to, but on Windows DLLs are alwa

Re: [Python-Dev] Starting CPython development w/ Docker

2015-04-21 Thread Ezio Melotti
On Mon, Apr 20, 2015 at 3:52 PM, Saul Shanabrook wrote: > I started trying some CPythong development a week ago at PyCon and first got > testing working using Docker on my mac. This had the advantage of not having > to worry about installing and dependencies, and also let me test on > different Py

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Donald Stufft
> On Apr 21, 2015, at 7:18 PM, Steve Dower wrote: > > Donald Stufft wrote: >> Is this version statically linked by any chance? > > No, there's no change to the compilation process, so you can get exactly the > same result by using the regular installer and copying the files around. > > Not su

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread James Edwards
Cory Benfield "python-dev@python.org" On Tue, Apr 21, 2015 at 8:47 AM, Cory Benfield wrote: > I'm talking from the position of being a library author, where supporting > versions of Python lower than 3.5 will be a reality for at least 5 more years. > I will not be able to inline my type hints,

Re: [Python-Dev] async/await PEP

2015-04-21 Thread Ryan Hiebert
On Apr 21, 2015, at 3:23 AM, Martin Teichmann wrote: > > Hi Yury, Hi List, > > I do certainly like the idea of PEP 492, just some small comments: > > why do we need two keywords? To me it is not necessarily intuitive > when to use async and when to use await (why is it async for and not > await

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Barker
Thank you Jack. Jack: "I hate code and I want as little of it as possible in our product" I love that quote -- and I ALWAYS use it when I teach newbies Python. It's kind of the point of Python -- you can get a lot done by writing very little code. I'm still confused about what all this type anno

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Barker
On Tue, Apr 21, 2015 at 11:58 AM, Paul Sokolovsky wrote: > It does, and hope people won't be caught in "static typechecking" > loop and consider other usages too. > I"m confused -- from the bit I've been skimming the discussion, over on python-ideas, and now here, is that this is all about "stat

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Barker
On Tue, Apr 21, 2015 at 2:33 AM, Cory Benfield wrote: > It seems like the only place the type annotations will get used is in > relatively trivial cases where the types are obvious anyway. I don't > deny that *some* bugs will be caught, but I suspect they'll > overwhelmingly be crass ones that wo

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Steve Dower
Paul Moore wrote: > On 20 April 2015 at 09:16, Larry Hastings wrote: >> There is now a third type of Windows installer for Python 3.5. In addition >> to the conventional installer and the web-based installer, Python 3.5 now >> has an embeddable installer designed to be run as part of a larger >>

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Donald Stufft
> On Apr 21, 2015, at 6:33 PM, Paul Moore wrote: > > On 21 April 2015 at 23:05, Steve Dower wrote: >> It is indeed just a run-and-dump extractor. I haven't had a chance to write >> up any docs for it yet, but there are some open bugs I want to fix first >> (specifically http://bugs.python.org

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Paul Moore
On 21 April 2015 at 23:05, Steve Dower wrote: > It is indeed just a run-and-dump extractor. I haven't had a chance to write > up any docs for it yet, but there are some open bugs I want to fix first > (specifically http://bugs.python.org/issue23955) before this becomes too > formalized. Thanks

Re: [Python-Dev] async/await in Python; v2

2015-04-21 Thread Damien George
Hi Yury, In your PEP 492 draft, in the Grammar section, I think you're missing the modifications to the "flow_stmt" line. Cheers, Damien. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 1:18 PM, Robert Collins wrote: > On 22 April 2015 at 04:28, Guido van Rossum wrote: > > Until some point in a possible but distant future when we're all thinking > > back fondly about the argument we're currently having, it will be the > choice > > of the author of new (a

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Robert Collins
On 22 April 2015 at 04:28, Guido van Rossum wrote: > On Tue, Apr 21, 2015 at 12:49 AM, Antoine Pitrou > wrote: >> >> On Mon, 20 Apr 2015 20:43:38 -0400 >> "R. David Murray" wrote: >> > +1 to this from me too. I'm afraid that means I'm -1 on the PEP. >> > >> > I didn't write this in my earlier em

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Paul Moore
On 20 April 2015 at 09:16, Larry Hastings wrote: > There is now a third type of Windows installer for Python 3.5. In addition > to the conventional installer and the web-based installer, Python 3.5 now > has an embeddable installer designed to be run as part of a larger > application's installer

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Moore
(Gmail messed up the attributions - apologies if I didn't fix them up correctly). 21 April 2015 at 19:55, Łukasz Langa wrote: >> >> On Apr 21, 2015, at 11:23 AM, Guido van Rossum wrote: >> >>> 2. Clearly, great thought has been put into this PEP. If anyone has a good >>> analysis of the potenti

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread R. David Murray
On Tue, 21 Apr 2015 21:31:49 +0300, Paul Sokolovsky wrote: > On Tue, 21 Apr 2015 09:50:59 -0700 Ethan Furman wrote: > > > On 04/21, Paul Sokolovsky wrote: > > > > > > And for example yesterday's big theme was people blackmailing that > > > they stop contributing to stdlib if annotations are in

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Moore
On 21 April 2015 at 17:55, Gregory P. Smith wrote: > I view most of this thread as FUD. The fear is understandable, I'm trying to > tell people to stop panicing. I think (hope!) everyone is clear that what's being expressed in this thread is honest (emotional) reactions. There's a negative connot

Re: [Python-Dev] [Distutils] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Donald Stufft
> On Apr 21, 2015, at 3:15 PM, Toshio Kuratomi wrote: > > On Tue, Apr 21, 2015 at 01:54:55PM -0400, Donald Stufft wrote: >> >> Anyways, I'll have access to the data set for another day or two before I >> shut down the (expensive) server that I have to use to crunch the numbers so >> if >> ther

Re: [Python-Dev] [Distutils] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Toshio Kuratomi
On Tue, Apr 21, 2015 at 01:54:55PM -0400, Donald Stufft wrote: > > Anyways, I'll have access to the data set for another day or two before I > shut down the (expensive) server that I have to use to crunch the numbers so > if > there's anything anyone else wants to see before I shut it down, speak

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 12:17:01 -0400 "R. David Murray" wrote: > On Tue, 21 Apr 2015 18:27:50 +0300, Paul Sokolovsky > wrote: > > > I was replying to Steven's message. Did you read it? > > > > Yes. And I try to follow general course of discussion, as its hard > > to follow individual sub-t

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Łukasz Langa
> On Apr 21, 2015, at 11:23 AM, Guido van Rossum wrote: > > 2. Clearly, great thought has been put into this PEP. If anyone has a good > analysis of the potential impact on Python 3 adoption, please do pass along. > I would be interested in reading the information. > > I wish I had a crystal

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2015-04-21 Thread Tal Einat
On Tue, Apr 21, 2015 at 8:31 PM, Larry Hastings wrote: > > On 04/21/2015 04:50 AM, Tal Einat wrote: > > As for the default set of accepted types for various convertors, if we > could choose any syntax we liked, something like "accept=+{NoneType}" > would be much better IMO. > > > In theory Argumen

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Alexander Belopolsky
On Tue, Apr 21, 2015 at 2:23 PM, Guido van Rossum wrote: > At least nobody will be writing type hints in Cyrillic. :-) Why not? It works just fine: >>> Список = list >>> def sum(x: Список): ... pass ... >>> (See https://en.wikipedia.org/wiki/Rapira for some prior art.) _

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 09:50:59 -0700 Ethan Furman wrote: > On 04/21, Paul Sokolovsky wrote: > > > > And for example yesterday's big theme was people blackmailing that > > they stop contributing to stdlib if annotations are in [...] > > A volunteer's honest reaction is not blackmail, and c

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 10:03 AM, Carol Willing < willi...@willingconsulting.com> wrote: > > Two areas of clarification would be helpful for me: > > 1. Optional: What does this really mean in practice? Am I opting in to > static type checking and type hints? Or must I opt out of type hints? > Havi

Re: [Python-Dev] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Guido van Rossum
Thanks for the detailed research! On Tue, Apr 21, 2015 at 10:54 AM, Donald Stufft wrote: > Just thought I'd share this since it shows how what people are using to > download things from PyPI have changed over the past year. Of particular > interest to most people will be the final graphs showing

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Carol Willing
On 4/21/15 9:17 AM, R. David Murray wrote: Please be respectful rather than inflammatory. Thank you David. If you read what I wrote, I did not say that I was going to stop contributing, I specifically talked about that gut reaction being both emotional and illogical. That doesn't make the reac

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread R. David Murray
On Tue, 21 Apr 2015 10:10:06 -0700, Guido van Rossum wrote: > On Tue, Apr 21, 2015 at 9:17 AM, R. David Murray > wrote: > > > Please be respectful rather than inflammatory. If you read what I > > wrote, I did not say that I was going to stop contributing, I > > specifically talked about that gu

[Python-Dev] Python 3.x Adoption for PyPI and PyPI Download Numbers

2015-04-21 Thread Donald Stufft
Just thought I'd share this since it shows how what people are using to download things from PyPI have changed over the past year. Of particular interest to most people will be the final graphs showing what percentage of downloads from PyPI are for Python 3.x or 2.x. As always it's good to keep in

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread R. David Murray
On Tue, 21 Apr 2015 16:55:49 -, "Gregory P. Smith" wrote: > We will not be putting type annotations anywhere in the stdlib or expecting > anyone else to maintain them there. That would never happen until tools > that are convincing enough in their utility for developers to _want_ to use > are

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Daniel Holth
On Tue, Apr 21, 2015 at 1:10 PM, Guido van Rossum wrote: > On Tue, Apr 21, 2015 at 9:17 AM, R. David Murray > wrote: >> >> Please be respectful rather than inflammatory. If you read what I >> wrote, I did not say that I was going to stop contributing, I >> specifically talked about that gut reac

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 9:47 AM, Antoine Pitrou wrote: > On Tue, 21 Apr 2015 09:28:45 -0700 > Guido van Rossum wrote: > > On Tue, Apr 21, 2015 at 12:49 AM, Antoine Pitrou > > wrote: > > > > > On Mon, 20 Apr 2015 20:43:38 -0400 > > > "R. David Murray" wrote: > > > > +1 to this from me too. I'm

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
On Tue, 21 Apr 2015 18:27:50 +0300 Paul Sokolovsky wrote: > Let me try: MicroPython already uses type annotations for statically > typed functions. E.g. > > def add(x:int, y:int): > return x + y > > will translate the function to just 2 machine instructions. That's quite nice. > Oh really,

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2015-04-21 Thread Larry Hastings
On 04/21/2015 04:50 AM, Tal Einat wrote: As for the default set of accepted types for various convertors, if we could choose any syntax we liked, something like "accept=+{NoneType}" would be much better IMO. In theory Argument Clinic could use any syntax it likes. In practice, under the cove

[Python-Dev] async/await in Python; v2

2015-04-21 Thread Yury Selivanov
Hi python-dev, I'm moving the discussion from python-ideas to here. The updated version of the PEP should be available shortly at https://www.python.org/dev/peps/pep-0492 and is also pasted in this email. Updates: 1. CO_ASYNC flag was renamed to CO_COROUTINE; 2. sys.set_async_wrapper() was re

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Steven D'Aprano
On Tue, Apr 21, 2015 at 03:51:05PM +0100, Cory Benfield wrote: > On 21 April 2015 at 15:31, Chris Angelico wrote: > > Granted, there are some > > vague areas - how many functions take a "file-like object", and are > > they all the same? - but between MyPy types and the abstract base > > types that

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 9:17 AM, R. David Murray wrote: > Please be respectful rather than inflammatory. If you read what I > wrote, I did not say that I was going to stop contributing, I > specifically talked about that gut reaction being both emotional and > illogical. That doesn't make the r

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Nikolaus Rath
On Apr 21 2015, Paul Sokolovsky wrote: > Hello, > > On Tue, 21 Apr 2015 08:05:59 -0700 > Nikolaus Rath wrote: > >> On Apr 20 2015, Chris Angelico wrote: >> > Maybe it'd be of value to have a quick "code stripper" that takes >> > away all the annotations, plus any other junk/framing that you're >

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 7:51 AM, Cory Benfield wrote: > The correct specification is "read method with this type signature" > and "seek method with this type signature". I would even be prepared > to waive the type signatures on read and seek, given that enforcing > the type hinting on others is

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Gregory P. Smith
On Tue, Apr 21, 2015 at 12:50 AM Antoine Pitrou wrote: > On Mon, 20 Apr 2015 20:43:38 -0400 > "R. David Murray" wrote: > > +1 to this from me too. I'm afraid that means I'm -1 on the PEP. > > > > I didn't write this in my earlier email because I wasn't sure about it, > > but my gut reaction afte

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Ethan Furman
On 04/21, Paul Sokolovsky wrote: > > And for example yesterday's big theme was people blackmailing that they > stop contributing to stdlib if annotations are in [...] A volunteer's honest reaction is not blackmail, and categorizing it as such is not helpful to the discussion. -- ~Ethan~

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
On Tue, 21 Apr 2015 09:28:45 -0700 Guido van Rossum wrote: > On Tue, Apr 21, 2015 at 12:49 AM, Antoine Pitrou > wrote: > > > On Mon, 20 Apr 2015 20:43:38 -0400 > > "R. David Murray" wrote: > > > +1 to this from me too. I'm afraid that means I'm -1 on the PEP. > > > > > > I didn't write this in

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 12:49 AM, Antoine Pitrou wrote: > On Mon, 20 Apr 2015 20:43:38 -0400 > "R. David Murray" wrote: > > +1 to this from me too. I'm afraid that means I'm -1 on the PEP. > > > > I didn't write this in my earlier email because I wasn't sure about it, > > but my gut reaction aft

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread R. David Murray
On Tue, 21 Apr 2015 18:27:50 +0300, Paul Sokolovsky wrote: > > I was replying to Steven's message. Did you read it? > > Yes. And I try to follow general course of discussion, as its hard to > follow individual sub-threads. And for example yesterday's big theme > was people blackmailing that they

Re: [Python-Dev] typeshed for 3rd party packages (was: Type hints -- a mediocre programmer's reaction)

2015-04-21 Thread Guido van Rossum
On Tue, Apr 21, 2015 at 12:33 AM, M.-A. Lemburg wrote: > On 21.04.2015 05:37, Guido van Rossum wrote: > > On Mon, Apr 20, 2015 at 4:41 PM, Jack Diederich > wrote: > >> * Uploading stubs for other people's code is a terrible idea. Who do I > >> contact when I update the interface to my library? T

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread R. David Murray
On Wed, 22 Apr 2015 01:09:52 +1000, Chris Angelico wrote: > def incremental_parser(input: FileLike) -> List[Token]: > tokens = [] > data = "" > while True: > if not data: > data = input.read(64) > token = Token(data[0]); data = data[1:] > while token

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2015-04-21 Thread Gregory P. Smith
On Mon, Apr 20, 2015 at 6:55 AM Barry Warsaw wrote: > On Apr 19, 2015, at 01:19 AM, Larry Hastings wrote: > > >We should rename "types" to "accept". "accept" should takes a set of > types; > >these types specify the types of Python objects the Clinic parameter > should > >accept. For the funny

Re: [Python-Dev] async/await PEP

2015-04-21 Thread Yury Selivanov
Hi Martin, On 2015-04-21 4:23 AM, Martin Teichmann wrote: Hi Yury, Hi List, I do certainly like the idea of PEP 492, just some small comments: Thank you! why do we need two keywords? To me it is not necessarily intuitive when to use async and when to use await (why is it async for and not a

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Jim Baker
On Tue, Apr 21, 2015 at 9:09 AM, Chris Angelico wrote: > ... > > Pretty accurate, yeah. Here's how I see it: > > def incremental_parser(input: FileLike) -> List[Token]: > tokens = [] > data = "" > while True: > if not data: > data = input.read(64) > token =

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Cory Benfield
On 21 April 2015 at 16:09, Chris Angelico wrote: > Pretty accurate, yeah. Here's how I see it: > > def incremental_parser(input: FileLike) -> List[Token]: > tokens = [] > data = "" > while True: > if not data: > data = input.read(64) > token = Token(data[0])

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 08:05:59 -0700 Nikolaus Rath wrote: > On Apr 20 2015, Chris Angelico wrote: > > Maybe it'd be of value to have a quick "code stripper" that takes > > away all the annotations, plus any other junk/framing that you're > > not interested in, and gives you something you c

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 16:11:51 +0200 Antoine Pitrou wrote: [] > >> You can't at the same time point out that type checking has no > >> power or control over runtime behaviour, and then claim that type > >> checking makes runtime behaviour (for example, ability to accept or > >> reject certa

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Angelico
On Wed, Apr 22, 2015 at 12:51 AM, Cory Benfield wrote: > On 21 April 2015 at 15:31, Chris Angelico wrote: >> Granted, there are some >> vague areas - how many functions take a "file-like object", and are >> they all the same? - but between MyPy types and the abstract base >> types that already ex

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Nikolaus Rath
On Apr 20 2015, Chris Angelico wrote: > Maybe it'd be of value to have a quick "code stripper" that takes away > all the annotations, plus any other junk/framing that you're not > interested in, and gives you something you can browse in a text > editor? If you need to preprocess your source code

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Cory Benfield
On 21 April 2015 at 15:31, Chris Angelico wrote: > Granted, there are some > vague areas - how many functions take a "file-like object", and are > they all the same? - but between MyPy types and the abstract base > types that already exist, there are plenty of ways to formalize duck > typing. Are

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Alexander Walters
So. This is how you try and get me to care about Python 3. Can't speak for others, but this does the opposite for me. This makes me ecstatic that Python 2 has a nearly-frozen api. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 15:08:27 +0200 Antoine Pitrou wrote: [] > Because the user might not run the type checker, obviously. To quote > you: """When we say that type checking is optional, we mean it.""" > > You can't at the same time point out that type checking has no > power or control o

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Angelico
On Tue, Apr 21, 2015 at 7:56 PM, Arnaud Delobelle wrote: > If people constantly get told by their editor / IDE that they are calling > function with the wrong argument types, what are they going to do? They may > start adopting the same approach as in Java / C++ etc... where interfaces > must be

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
Le 21/04/2015 15:50, Paul Sokolovsky a écrit : > Hello, > > On Tue, 21 Apr 2015 15:08:27 +0200 > Antoine Pitrou wrote: > > [] > >> Because the user might not run the type checker, obviously. To quote >> you: """When we say that type checking is optional, we mean it.""" >> >> You can't at the sa

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Steven D'Aprano
On Tue, Apr 21, 2015 at 03:08:27PM +0200, Antoine Pitrou wrote: > On Tue, 21 Apr 2015 22:47:23 +1000 > Steven D'Aprano wrote: > > > > Ironically, type hinting will *reduce* the need for intrusive, > > anti-duck-testing explicit calls to isinstance() at runtime: > > It won't, since as you pointe

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Barry Warsaw
On Apr 21, 2015, at 01:34 PM, Steven D'Aprano wrote: >Putting the type information in a stub file is an exponentially more distant >fourth best, or to put it another way, *the worst* solution for where to put >type hints. Not only do you Repeat Yourself with the name of the parameter, >but also th

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Sokolovsky
Hello, On Tue, 21 Apr 2015 11:56:15 +0100 Rob Cliffe wrote: > On 21/04/2015 10:33, Cory Benfield wrote: > > On 21 April 2015 at 10:10, Chris Angelico wrote: > >> At this point, you may want to just stop caring about the exact > >> type. Part of the point of gradual typing is that you can > >> s

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Arnaud Delobelle
On Tue, 21 Apr 2015 at 09:59 Cory Benfield wrote: [...] > Further, Python's type system is not sufficiently flexible to allow > library authors to adequately specify the types their code actually > works on. I need to be able to talk about interfaces, because > interfaces are the contract around

Re: [Python-Dev] async/await PEP

2015-04-21 Thread Martin Teichmann
Hi Yury, Hi List, I do certainly like the idea of PEP 492, just some small comments: why do we need two keywords? To me it is not necessarily intuitive when to use async and when to use await (why is it async for and not await for?), so wouldn't it be much simpler, and more symmetric, to just hav

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Harry Percival
Hey, I just wanted to say to everyone, thanks for being so patient and willing to engage with this discussion, despite my not having done my research and read the (substantial) prior discussion on the topic. Here it is (or at least, some of it!) for any other newcomers: https://mail.python.org/p

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Withers
On 20/04/2015 19:30, Harry Percival wrote: Hi all, tldr; type hints in python source are scary. Would reserving them for stub files be better? I was trying to find Jack's original post as I think his summary is excellent and aligns well with where I think I'm coming from on this: https://mai

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Withers
On 20/04/2015 20:09, Paul Moore wrote: On 20 April 2015 at 19:41, Barry Warsaw wrote: tldr; type hints in python source are scary. Would reserving them for stub files be better? I think so. I think PEP 8 should require stub files for stdlib modules and strongly encourage them for 3rd party co

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
On Tue, 21 Apr 2015 23:16:19 +1000 Steven D'Aprano wrote: > > I could keep going, but I hope I've made my point. I don't think so. Just because other languages are looking at it doesn't mean it will end up successful. It means it's an interesting idea, that's all. A litmus test for this PEP wou

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Paul Moore
On 21 April 2015 at 13:47, Steven D'Aprano wrote: > On Tue, Apr 21, 2015 at 11:56:15AM +0100, Rob Cliffe wrote: > >> (Adding a type hint that restricted the argument to say a >> sequence of numbers turns out to be a mistake. > > Let's find out how big a mistake it is with an test run. > >

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Steven D'Aprano
On Tue, Apr 21, 2015 at 01:25:34PM +0100, Chris Withers wrote: > Anyway, I've not posted much to python-dev in quite a while, but this is > a topic that I would be kicking myself in 5-10 years time when I've had > to move to Javascript or because everyone > else has drifted away from Python as

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
On Tue, 21 Apr 2015 22:47:23 +1000 Steven D'Aprano wrote: > > Ironically, type hinting will *reduce* the need for intrusive, > anti-duck-testing explicit calls to isinstance() at runtime: It won't, since as you pointed out yourself, type checks are purely optional and entirely separate from com

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Cory Benfield
On 21 April 2015 at 12:23, Gustavo Carneiro wrote: > Documentation is not checked. It often loses sync with the actual code. > Docs say one thing, code does another. Agreed. I don't think anyone would disagree here. I'm talking from the position of being a library author, where supporting versio

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Steven D'Aprano
On Tue, Apr 21, 2015 at 11:56:15AM +0100, Rob Cliffe wrote: > (Adding a type hint that restricted the argument to say a > sequence of numbers turns out to be a mistake. Let's find out how big a mistake it is with an test run. py> def sorter(alist: List[int]) -> List[int]: ... return

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Withers
On 21/04/2015 12:23, Gustavo Carneiro wrote: Well, (i) can be done with good documentation (docstrings etc.). Documentation is not checked. It often loses sync with the actual code. Docs say one thing, code does another. That certainly something that could be fixed by formalising th

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Withers
On 20/04/2015 19:30, Harry Percival wrote: Hi all, tldr; type hints in python source are scary. Would reserving them for stub files be better? I think Jack's summary of this is excellent and aligns well with where I think I'm coming from on this: https://mail.python.org/pipermail/python-dev

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Withers
On 20/04/2015 20:09, Paul Moore wrote: On 20 April 2015 at 19:41, Barry Warsaw wrote: tldr; type hints in python source are scary. Would reserving them for stub files be better? I think so. I think PEP 8 should require stub files for stdlib modules and strongly encourage them for 3rd party co

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2015-04-21 Thread Tal Einat
On Sun, Apr 19, 2015 at 11:19 AM, Larry Hastings wrote: > > > On 08/07/2014 09:41 PM, Larry Hastings wrote: > > Well! It's rare that the core dev community is so consistent in its > opinion. I still think "nullable" is totally appropriate, but I'll change > it to "allow_none". > > > (reviving ei

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Gustavo Carneiro
On 21 April 2015 at 11:56, Rob Cliffe wrote: > On 21/04/2015 10:33, Cory Benfield wrote: > > On 21 April 2015 at 10:10, Chris Angelico > wrote: > > At this point, you may want to just stop caring about the exact type. > Part of the point of gradual typing is that you can short-cut a lot of >

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Rob Cliffe
On 21/04/2015 10:33, Cory Benfield wrote: On 21 April 2015 at 10:10, Chris Angelico wrote: At this point, you may want to just stop caring about the exact type. Part of the point of gradual typing is that you can short-cut a lot of this. And quite frankly, this isn't really helping anything. Ju

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Steven D'Aprano
On Mon, Apr 20, 2015 at 08:37:28PM -0700, Guido van Rossum wrote: > On Mon, Apr 20, 2015 at 4:41 PM, Jack Diederich wrote: > > > Twelve years ago a wise man said to me "I suggest that you also propose a > > new name for the resulting language" > > > > The barrage of FUD makes me feel like the wo

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Cory Benfield
On 21 April 2015 at 10:10, Chris Angelico wrote: > At this point, you may want to just stop caring about the exact type. > Part of the point of gradual typing is that you can short-cut a lot of > this. And quite frankly, this isn't really helping anything. Just skip > it and say that it's Union[Ma

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Chris Angelico
On Tue, Apr 21, 2015 at 6:58 PM, Cory Benfield wrote: > On 21 April 2015 at 01:45, Chris Angelico wrote: >> When you're writing a library, it can be a great help to provide type >> annotations, because every application that uses your library can >> benefit. > > It can be a great help to whom? No

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Cory Benfield
On 21 April 2015 at 01:45, Chris Angelico wrote: > When you're writing a library, it can be a great help to provide type > annotations, because every application that uses your library can > benefit. It can be a great help to whom? Not to me (the library author), because I can't use them in my li

Re: [Python-Dev] Type hints -- a mediocre programmer's reaction

2015-04-21 Thread Antoine Pitrou
On Mon, 20 Apr 2015 20:43:38 -0400 "R. David Murray" wrote: > +1 to this from me too. I'm afraid that means I'm -1 on the PEP. > > I didn't write this in my earlier email because I wasn't sure about it, > but my gut reaction after reading Harry's email was "if type annotations > are used in the s

Re: [Python-Dev] typeshed for 3rd party packages (was: Type hints -- a mediocre programmer's reaction)

2015-04-21 Thread M.-A. Lemburg
On 21.04.2015 05:37, Guido van Rossum wrote: > On Mon, Apr 20, 2015 at 4:41 PM, Jack Diederich wrote: >> * Uploading stubs for other people's code is a terrible idea. Who do I >> contact when I update the interface to my library? The random Joe who >> "helped" by uploading annotations three months