-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move typing out of the stdlib in Python 3.7? #495
Comments
I haven't made up my mind yet. Here are some thoughts. Extra cons:
Extra pros:
Brainstoming:
|
I don't have a strong opinion yet. Here are some additional things to think about:
Also, it would be nice to update 3.5 and 3.6 documentation to mention that |
More discussion on python-dev: https://mail.python.org/pipermail/python-dev/2017-November/150110.html (observes that NamedTuple should be moved out then). And python-ideas: https://mail.python.org/pipermail/python-ideas/2017-November/047655.html |
Whoa, this is not something I expected to wake up to this morning :D And by cross-posting to python-dev and python-ideas you sure made it hard for yourself to keep track of the entire discussion. I'll post here, as "the smallest audience available to me." I hope this is fine. In general, I think this is a good idea for the evolution of PEP 563If First I thought we could move the core functionality of Psychological significance"Removing" typing feels like defeat, like a failure of the provisional package. We might try to argue that it's about development velocity etc. but the emotional reaction is what it is. We added a module to Python and now we're removing it. Way outI have an idea how this all might fit together but I will need more time today to form it well. |
I'm also a bit worried about the psychological effect. People will see "typing is no longer in the stdlib" and conclude "oh, Python gave up on static typing". |
I think I came to a conclusion. I think moving Details on how I'd handle this are in #496. |
Since there's so little time until beta 1, let's consider our options. If your main concern is the dreadful ergonomy of If you really hate that option (why?) then the alternative is to figure out how to bundle I wholeheartedly agree that |
I agree that keeping PEP 484 provisional makes a lot of sense. I just re-read the relevant parts of PEP 411, which I see as a guideline of provisional packages, and similarly provisional peps. The PEP says "Some reasons for not graduating are... the package may prove to be unstable". Also that "Withdrawals are expected to be rare." I think we are all in agreement that there are some changes we would like to make to the API. I also want to make an argument for keeping it provisional for the users' sake.
|
One thing to note is that even if we move typing out of the standard library, I don't think it'll be possible to get rid of or change typing_extensions, at least, unless...
That said, perhaps these aren't too big prices to pay? If we go with option 1, for example, we'd basically be assuming that people only care able supporting the latest version of Python and perhaps Python 2.7, which I suppose isn't too unreasonable... (?) It does add another barrier for people who want to convert an existing project over to using types though. |
I think we should not do this. Here are some thoughts:
|
Yes, the most promising plan is to keep it with the distributions but make it upgradable. I'm not sure if we could then claim it's no longer provisional -- non-provisional also forbids new features in bugfix releases. But regardless, the upgradability will remove most pressure to sync up with the CPython release cycle, allowing us to iterate faster. |
I've pondered this some more and it looks like there will be too many issues if we move typing out of the stdlib. Even if we kept it in the distribution bundles (like pip) there would be too many ways for users to shoot themselves in the foot, and for distributions to unbundle it, and it would send the wrong signal to people who want to start using type annotations. So after long deliberation I am closing this issue. Instead we should keep the |
One more thing that may still be worth discussing is do we need to add a "limited provisional" (or similar) status to PEP 411 that would mean like provisional but with backwards compatibility? Then we can declare that |
Either it's stable or it's not. A state in-between seems both too limiting for fast iteration and yet still too volatile for conservative users to accept. As long as a package is provisional, it's not possible to accurately predict whether we'll need to break compatibility in the future.
|
I would not call possibility to add new features in minor releases instability. This is the only thing we need. As I explained above it is highly unlikely that it will be necessary to make incompatible changes to the runtime |
I'm with Ivan. I don't think we need to update PEP 411, we can just put
this in the docs for the typing module.
…On Mon, Nov 13, 2017 at 9:13 AM, Ivan Levkivskyi ***@***.***> wrote:
I would not call possibility to add new features in minor releases
instability. This is the only thing we need. As I explained above it is
highly unlikely that it will be necessary to make incompatible changes to
the *runtime* typing API.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#495 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMpUj-orIzpXG5cW__DevJT-iFbyyks5s2HitgaJpZM4QRLKq>
.
--
--Guido van Rossum (python.org/~guido)
|
I'm wondering if we should remove
typing
from the stdlib. Now's the time to think about this, as the feature freeze for 3.7 is about 12 weeks away.Cons:
typing_extensions
)typing
module was always provisional)Pros:
typing
module can evolve much faster outside the stdlibtyping_extensions
(and maybe evenmypy_extensions
)If we don't do this I worry that we're entering a period where many new typesystem features end up in
typing_extensions
and users will be confused about which items are intyping
and which intyping_extensions
(not to mentionmypy_extensions
). Anything new to be added to typing (e.g.Const
,Final
,Literal
, or changing ABCs to Protocols) would have to be added totyping_extensions
instead, and users would be confused about which features exist in which module. Movingtyping
out of the stdlib can make things potentially simpler, at the cost of an extrapip install
(but they'll need one anyway formypy
).Thoughts?
The text was updated successfully, but these errors were encountered: