Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Eric V. Smith
On 11/6/2017 1:40 PM, Barry Warsaw wrote: On Nov 6, 2017, at 08:02, Victor Stinner wrote: While discussions on the typing module are still hot, what do you think of allowing annotations in the standard libraries, but limited to a few basic types: I’m still -1 on adding annotations to the std

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Tres Seaver
On 11/06/2017 01:25 PM, R. David Murray wrote: > Maybe I'm being a curmudgeon standing in the way of progress, but I'm > pretty sure there are a number of people in my camp :) I'm definitely there: anything which optimizes machine-readabilty over readability for the Mark 1 eyeball is a lose. Tre

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Barry Warsaw
On Nov 6, 2017, at 08:02, Victor Stinner wrote: > > While discussions on the typing module are still hot, what do you > think of allowing annotations in the standard libraries, but limited > to a few basic types: I’m still -1 on adding annotations to the stdlib, despite their increasing use out

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Brett Cannon
On Mon, Nov 6, 2017, 10:27 R. David Murray, wrote: > I agree with Steve. There is *cognitive* overhead to type annotations. > I find that they make Python code harder to read and understand. So I > object to them in the documentation and docstrings as well. (Note: > while I agree that the nota

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread R. David Murray
I agree with Steve. There is *cognitive* overhead to type annotations. I find that they make Python code harder to read and understand. So I object to them in the documentation and docstrings as well. (Note: while I agree that the notation is compact for the simple types, the fact that it would

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Steve Holden
While I appreciate the value of annotations I think that *any* addition of them to the stdlib would complicate an important learning resource unnecessarily. S Steve Holden On Mon, Nov 6, 2017 at 4:07 PM, Victor Stinner wrote: > Related to annotations, are you ok to annotate basic types in the >

Re: [Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Victor Stinner
Related to annotations, are you ok to annotate basic types in the *documentation* and/or *docstrings* of the standard library? For example, I chose to document the return type of time.time() (int) and time.time_ns() (float). It's short and I like how it's formatted. See the current rendered docume

[Python-Dev] Allow annotations using basic types in the stdlib?

2017-11-06 Thread Victor Stinner
Hi, While discussions on the typing module are still hot, what do you think of allowing annotations in the standard libraries, but limited to a few basic types: * None * bool, int, float, complex * bytes, bytearray * str I'm not sure about container types like tuple, list, dict, set, frozenset.