Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Guido van Rossum
Let me just cut this short. typing.py will stay, and it will stay provisional. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.pyt

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Lukasz Langa
> On Nov 7, 2017, at 2:33 PM, Nick Coghlan wrote: > > On 8 November 2017 at 04:41, Lukasz Langa wrote: >> 4. How do we even version this library then? Probably like this: 3.7.0.0, >> 3.7.0.1, 3.7.1.0, and so on. But that depends on answers to the other >> questions above. > > Something you may

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Nick Coghlan
On 8 November 2017 at 04:41, Lukasz Langa wrote: > 4. How do we even version this library then? Probably like this: 3.7.0.0, > 3.7.0.1, 3.7.1.0, and so on. But that depends on answers to the other > questions above. Something you may want to consider is switching to CalVer for typing itself, such

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Barry Warsaw
On Nov 7, 2017, at 10:41, Lukasz Langa wrote: > 3. Does that mean that Debian is going to rip it out and make people install > a `python-typing` .deb? Sadly, probably yes. We need to figure out what that > means for us. Maybe. Full disclosure, I’ve recently scaled back my contributions to Deb

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Lukasz Langa
> On Nov 7, 2017, at 9:39 AM, Brett Cannon wrote: > > On Tue, 7 Nov 2017 at 03:34 Paul Moore > wrote: > > Because type annotations are a development-time feature, they should > *not* require a dependency in the final deployment (apart from Python > itself). However,

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Lukasz Langa
> On Nov 6, 2017, at 8:01 PM, Nick Coghlan wrote: > > As I indicated in my comment there, I'm now wondering if there might > be an opportunity here whereby we could use the *dataclasses* module > to define a stable non-provisional syntactically compatible subset of > the typing module, and requi

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Brett Cannon
On Tue, 7 Nov 2017 at 03:34 Paul Moore wrote: > On 7 November 2017 at 10:18, Steve Holden wrote: > > On Tue, Nov 7, 2017 at 12:35 AM, Donald Stufft wrote: > > [..] > > > >> > >> Maybe we just need to fully flesh out the idea of a "Python Core" (What > >> exists now as “Python”) and a “Python Pl

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Paul Moore
On 7 November 2017 at 10:18, Steve Holden wrote: > On Tue, Nov 7, 2017 at 12:35 AM, Donald Stufft wrote: > [..] > >> >> Maybe we just need to fully flesh out the idea of a "Python Core" (What >> exists now as “Python”) and a “Python Platform” (Python Core + A select set >> of preinstalled librari

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Steve Holden
On Tue, Nov 7, 2017 at 12:35 AM, Donald Stufft wrote: [..] > Maybe we just need to fully flesh out the idea of a "Python Core" (What > exists now as “Python”) and a “Python Platform” (Python Core + A select set > of preinstalled libraries). Then typing can just be part of the Python > Platform,

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Paul Moore
On 7 November 2017 at 05:20, Ethan Smith wrote: > I'm not so keen on this because I think some things in typing (such as > NamedTuple) probably deserve to be in the collections module. And some of > the ABCs could probably also be merged with collections.abc but doing this > correctly and not all

Re: [Python-Dev] Remove typing from the stdlib

2017-11-07 Thread Paul Moore
On 7 November 2017 at 00:35, Donald Stufft wrote: > Maybe we just need to fully flesh out the idea of a "Python Core" (What > exists now as “Python”) and a “Python Platform” (Python Core + A select set > of preinstalled libraries). Then typing can just be part of the Python > Platform, and gets in

Re: [Python-Dev] Remove typing from the stdlib

2017-11-06 Thread Ethan Smith
> Beyond the API already proposed in PEP 557, this would mean adding: > > * dataclasses.ClassVar (as proposed above) > * dataclasses.Any (probably just set to the literal string > "dataclasses.Any") > * dataclasses.NamedTuple (as a replacement for typing.NamedTuple) > * potentially dataclasses.is_c

Re: [Python-Dev] Remove typing from the stdlib

2017-11-06 Thread Nick Coghlan
On 6 November 2017 at 12:18, Nick Coghlan wrote: > That particular dependency could also be avoided by defining an > "is_class_var(annotation)" generic function and a "ClassVar" helper > object in the dataclasses module. For example: > > class _ClassVar: > def __init__(self, annotation

Re: [Python-Dev] Remove typing from the stdlib

2017-11-06 Thread Donald Stufft
> On Nov 6, 2017, at 4:35 AM, Paul Moore wrote: > > 1. Without typing available, some programs using type annotations > won't run. That is, using type annotations (a > test-time/development-time feature) introduces a runtime dependency on > typing, and hence introduces an extra deployment conce

Re: [Python-Dev] Remove typing from the stdlib

2017-11-06 Thread Paul Moore
On 6 November 2017 at 03:41, Lukasz Langa wrote: > >> On 4 Nov, 2017, at 3:39 AM, Paul Moore wrote: >> >> Lukasz Langa said: >>> So, the difference is in perceived usability. It's psychological. >> >> Please, let's not start the "not in the stdlib isn't an issue" debate >> again. If I concede it'

Re: [Python-Dev] Remove typing from the stdlib

2017-11-05 Thread Lukasz Langa
> On 4 Nov, 2017, at 3:39 AM, Paul Moore wrote: > > Lukasz Langa said: >> So, the difference is in perceived usability. It's psychological. > > Please, let's not start the "not in the stdlib isn't an issue" debate > again. If I concede it's a psychological issue, will you concede that > the fac

Re: [Python-Dev] Remove typing from the stdlib

2017-11-05 Thread Nick Coghlan
On 4 November 2017 at 02:46, Eric V. Smith wrote: > On 11/3/2017 12:15 PM, Victor Stinner wrote: >> >> Hi, >> >> 2017-11-03 15:36 GMT+01:00 Guido van Rossum : >>> >>> Maybe we should remove typing from the stdlib? >>> https://github.com/python/typing/issues/495 > > >> The typing module is not used

Re: [Python-Dev] Remove typing from the stdlib

2017-11-05 Thread Raymond Hettinger
> On Nov 3, 2017, at 9:15 AM, Victor Stinner wrote: > > 2017-11-03 15:36 GMT+01:00 Guido van Rossum : >> Maybe we should remove typing from the stdlib? >> https://github.com/python/typing/issues/495 > > I'm strongly in favor on such move. > > My experience with asyncio in the stdlib is that us

Re: [Python-Dev] Remove typing from the stdlib

2017-11-05 Thread Brett Cannon
On Fri, 3 Nov 2017 at 17:59 Lukasz Langa wrote: > > > On 3 Nov, 2017, at 4:01 PM, Victor Stinner > wrote: > > > > The question is if you would only need or > pip install typing>. > > > > If typing is removed from the stdlib, you can still use it in your > > application. It's "just" another dep

Re: [Python-Dev] Remove typing from the stdlib

2017-11-04 Thread Paul Moore
On 4 November 2017 at 03:53, Nick Coghlan wrote: > If I understand correctly, a lot of the complexity in the current > typing.py implementation is there to make isinstance and issubclass do > something "useful" at runtime, and to allow generics to be used as > base classes. > > If it wasn't for th

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Nick Coghlan
On 4 November 2017 at 04:24, Guido van Rossum wrote: > A side note (I'm reading all responses but staying out of the discussion): > > No static checker should depend on the *contents* of typing.py, since it's > just a bunch of runtime gymnastics to allow types to be evaluated at runtime > without

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Lukasz Langa
> On 3 Nov, 2017, at 4:01 PM, Victor Stinner wrote: > > The question is if you would only need or pip install typing>. > > If typing is removed from the stdlib, you can still use it in your > application. It's "just" another dependency no? The ideal situation is that something is built-in a

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Victor Stinner
2017-11-03 18:00 GMT+01:00 Steve Dower : > If not having typing installed means you can't use "Any" or "Optional" in an > annotation, that basically kills the whole thing. Some primitives need to be > there. I'm not sure that I understand you. The question is if you would only need or . If typi

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Sven R. Kunze
On 03.11.2017 21:34, Paul Moore wrote: Consider someone who's downloaded Python and PyCharm (or Visual Studio). They want to get the benefit of the IDE code completion facilities, so they declare their argument as List[int], following the information they've found on how to declare lists of integ

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Paul Moore
On 3 November 2017 at 17:00, Steve Dower wrote: > > I'm torn. > > If not having typing installed means you can't use "Any" or "Optional" in an > annotation, that basically kills the whole thing. Some primitives need to be > there. Thinking some more about this, I think that it's now established t

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Barry Warsaw
On Nov 3, 2017, at 10:00, Steve Dower wrote: > > On 03Nov2017 0915, Victor Stinner wrote: >> Hi, >> 2017-11-03 15:36 GMT+01:00 Guido van Rossum : >>> Maybe we should remove typing from the stdlib? >>> https://github.com/python/typing/issues/495 >> I'm strongly in favor on such move. > > I'm torn

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Stéfane Fermigier
On Fri, Nov 3, 2017 at 6:47 PM, Antoine Pitrou wrote: > On Fri, 3 Nov 2017 12:46:33 -0400 > "Eric V. Smith" wrote: > > On 11/3/2017 12:15 PM, Victor Stinner wrote: > > > Hi, > > > > > > 2017-11-03 15:36 GMT+01:00 Guido van Rossum : > > >> Maybe we should remove typing from the stdlib? > > >> htt

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Steve Dower
On 03Nov2017 1124, Guido van Rossum wrote: A side note (I'm reading all responses but staying out of the discussion): No static checker should depend on the *contents* of typing.py, since it's just a bunch of runtime gymnastics to allow types to be evaluated at runtime without errors, with a s

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Antoine Pitrou
Le 03/11/2017 à 19:34, Stéfane Fermigier a écrit : > > On Fri, Nov 3, 2017 at 6:47 PM, Antoine Pitrou > wrote: > > I don't think other modules should start relying on the typing module at > runtime. > > They already do, as I've noted in my message about depe

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Guido van Rossum
A side note (I'm reading all responses but staying out of the discussion): No static checker should depend on the *contents* of typing.py, since it's just a bunch of runtime gymnastics to allow types to be evaluated at runtime without errors, with a secondary goal of making them introspectable (so

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Antoine Pitrou
Also, as for dataclasses specifically, since it may become as pervasive as namedtuples, we probably want it to be as light-weight as possible. Which will be harder to achieve if its *API* depends on the typing machinery. Regards Antoine. Le 03/11/2017 à 19:04, Paul Moore a écrit : > On 3 Novem

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Steve Dower
On 03Nov2017 0915, Victor Stinner wrote: Hi, 2017-11-03 15:36 GMT+01:00 Guido van Rossum : Maybe we should remove typing from the stdlib? https://github.com/python/typing/issues/495 I'm strongly in favor on such move. I'm torn. If not having typing installed means you can't use "Any" or "O

Re: [Python-Dev] Remove typing from the stdlib (was: Reminder: 12 weeks to 3.7 feature code cutoff)

2017-11-03 Thread Jelle Zijlstra
2017-11-03 10:46 GMT-07:00 Brett Cannon : > > > On Fri, 3 Nov 2017 at 08:09 Paul Moore wrote: > >> On 3 November 2017 at 14:50, Serhiy Storchaka >> wrote: >> > 03.11.17 16:36, Guido van Rossum пише: >> >> Maybe we should remove typing from the stdlib? >> >> https://github.com/python/typing/issue

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Paul Moore
On 3 November 2017 at 17:47, Antoine Pitrou wrote: > On Fri, 3 Nov 2017 12:46:33 -0400 > "Eric V. Smith" wrote: >> On 11/3/2017 12:15 PM, Victor Stinner wrote: >> > Hi, >> > >> > 2017-11-03 15:36 GMT+01:00 Guido van Rossum : >> >> Maybe we should remove typing from the stdlib? >> >> https://githu

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Antoine Pitrou
On Fri, 3 Nov 2017 12:46:33 -0400 "Eric V. Smith" wrote: > On 11/3/2017 12:15 PM, Victor Stinner wrote: > > Hi, > > > > 2017-11-03 15:36 GMT+01:00 Guido van Rossum : > >> Maybe we should remove typing from the stdlib? > >> https://github.com/python/typing/issues/495 > > > The typing module i

Re: [Python-Dev] Remove typing from the stdlib (was: Reminder: 12 weeks to 3.7 feature code cutoff)

2017-11-03 Thread Brett Cannon
On Fri, 3 Nov 2017 at 08:09 Paul Moore wrote: > On 3 November 2017 at 14:50, Serhiy Storchaka wrote: > > 03.11.17 16:36, Guido van Rossum пише: > >> Maybe we should remove typing from the stdlib? > >> https://github.com/python/typing/issues/495 > > > > I didn't use typing, but AFAIK the most use

Re: [Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Eric V. Smith
On 11/3/2017 12:15 PM, Victor Stinner wrote: Hi, 2017-11-03 15:36 GMT+01:00 Guido van Rossum : Maybe we should remove typing from the stdlib? https://github.com/python/typing/issues/495 The typing module is not used yet in the stdlib, so there is no technically reason to keep typing part of

[Python-Dev] Remove typing from the stdlib

2017-11-03 Thread Victor Stinner
Hi, 2017-11-03 15:36 GMT+01:00 Guido van Rossum : > Maybe we should remove typing from the stdlib? > https://github.com/python/typing/issues/495 I'm strongly in favor on such move. My experience with asyncio in the stdlib is that users expect changes faster than the very slow release process of

Re: [Python-Dev] Remove typing from the stdlib (was: Reminder: 12 weeks to 3.7 feature code cutoff)

2017-11-03 Thread Paul Moore
On 3 November 2017 at 14:50, Serhiy Storchaka wrote: > 03.11.17 16:36, Guido van Rossum пише: >> Maybe we should remove typing from the stdlib? >> https://github.com/python/typing/issues/495 > > I didn't use typing, but AFAIK the most used feature from typing is > NamedTuple. If move NamedTuple an

[Python-Dev] Remove typing from the stdlib (was: Reminder: 12 weeks to 3.7 feature code cutoff)

2017-11-03 Thread Serhiy Storchaka
03.11.17 16:36, Guido van Rossum пише: > Maybe we should remove typing from the stdlib? > https://github.com/python/typing/issues/495 I didn't use typing, but AFAIK the most used feature from typing is NamedTuple. If move NamedTuple and maybe other convenient classes not directly related to typ