10 ms·
Python 3.9 is around the corner
- jepler 6y agoCan you swap the link to https://lwn.net/SubscriberLink/831783/44f4191759587fb7/ https://lwn.net/SubscriberLink/831783/44f4191759587fb7/
- stingraycharles 6y agoI agree, but having said this: please consider subscribing to LWN. It’s one of the few places with high quality articles like these, which is increasingly rare nowadays. Subscribing and supporting them directly helps the cause of keeping projects like these alive.
- j4ah4n 6y agoMaybe for myself and others.. what is LWN explicitly? (Link)
- j4ah4n 6y agoOh geez. Immediately upon asking I see in the parent post sorry
- aorth 6y agoFor the record LWN editor corbet has said in the past that he's OK with LWN subscriber links being posted here: https://news.ycombinator.com/item?id=1966033 https://news.ycombinator.com/item?id=1966033 Also, the LWN FAQ says that it's OK as it serves as marketing and helps get new subscribers: https://lwn.net/op/FAQ.lwn#slinks https://lwn.net/op/FAQ.lwn#slinks P.S. I am a long-time paying LWN subscriber...
- jasonpeacock 6y agoWhat I like about regular, shorter (12mo vs 18mo) is it helps users exercise their "upgrade muscles". For those that care, they can establish procedures and then practice them (and improve them) to update their dependencies. This helps immensely down the road when security patches are released or other dependencies have significant updates. It turns such updates into boring non-events. Otherwise users only update their dependencies due to security threats or dead dependencies, and it always results in a stress-filled circus usually followed by outages & bugs.
- tehjoker 6y agoThis is true, but shorter intervals are also exhausting. It gets less tiresome with practice, but I really wish there was a stable environment to work in sigh.
- Kalium 6y agoYou can always pin to an older version for both your runtime and your libs. That seems, naively, like it would produce exactly what you're looking for. Perhaps I'm mistaken. Though this will tend to come at the cost of making upgrades and patches into significantly more work, as they will be larger and you less used to doing so. As the user said, "a stress-filled circus usually followed by outages & bugs". What kind of stable environment to work in do you imagine?
- tehjoker 6y agoThe problem is when you depend on a SAS like Google Cloud Storage or some such. If you stay pinned, eventually the service can break. I don't have a great solution, it's just such a grind to keep things updated.
- Kalium 6y agoI agree. It's such a pain when one cannot simply sit athwart the world and command "Stop!". I find the world can be a very inconvenient places at times. From where I'm sitting, the best option on offer for coping with this inconsiderate world is to keep in practice applying your updates on a regular cadence. It may be a grind, but it's perhaps one that gets easier as you do it more often. It certainly makes for smaller, more regular updates that in my experience are often more manageable.
- birdyrooster 6y agoSo skip a minor version here or there. Problem solved.
- klyrs 6y ago
- akimball 6y agoLike the muon. "Who ordered that?"
- cozzyd 6y agoIt's funny because that joke would work a lot better with tauthon.
- tobltobs 6y ago> Developers should be aware of some features that are being deprecated and removed in 3.9, as well as some more deprecations that are coming in 3.10. Many Python 2.7 functions that emit a DeprecationWarning in version 3.8 "have been removed or will be removed soon" starting with version 3.9.
- aprdm 6y agoArgh, Python is moving too fast. 3.8 has barely settled in with the walrus operator. For people doing docker based stuff with the latest and greatest always it might be OK, however, for enterprise environments where OS versions do not move as fast and you have runtime dependencies everywhere it isn't good. We have to build C++ libs against python versions, have thousands of users having their workstation in a sane version of python globally where all dependencies (1k+ in-house/external packages) work well and etc. etc. (think CAD kind of software / Qt UIs) We were still in the process of migrating towards python3.7 and it was a huge effort for barely any real gain. Hopefully new libraries do not use 3.8/3.9 only features otherwise we're in for a bad time..
- cozzyd 6y agoThe Python packaging "solution" is to have a whole Python world for everything you want to run (aka insanity).
- postpawl 6y agoHeard of virtualenv?
- cozzyd 6y agoYes... that's exactly what I was referring to. The problem is this: https://github.com/pypa/packaging-problems/issues/328 https://github.com/pypa/packaging-problems/issues/328
- rbanffy 6y agoI've been thinking of offering a patch to `fdupes` to turn duplicates into CoW copies. ZFS and BtrFS have them covered, but I'm not sure about APFS and I bet NTFS doesn't. In any case, it's really hard to get a workstation with less than a terabyte of storage in it. I have 2.9 gigs under mine and that's for 53 environments. I'm not sure that's a huge issue.
- 6y ago
- wodenokoto 6y ago> this [article] will become freely available on October 1, 2020 Hope to see this resurface in 2 days!
- wodenokoto 6y ago> Type hints in Python are mostly for linters and code checkers, as they are not enforced at run time by CPython. PEP 585 When you think about why that is, it makes sense, but I still find it annoying that while my type hints are not enforced, if I type-hint to an object that doesn't exist, I still get a run-time error. I kinda wish that these hints would just be interpreted as comments during runtime.
- techdragon 6y agoThere’s a good pattern for this using “if typing.TYPE_CHECKING:”... by either only importing them while type checking or by checking “if not typing.TYPE_CHECKING:” you could set an object type like Any, or your own custom one, as the value of all your imported types which should avoid most runtime errors I can think of.
- leontrolski 6y agoThis doesn't solve your problem, but for anyone else reading who may not be aware - there is (at least one) library that does runtime checking with your type hints: https://typeguard.readthedocs.io/en/latest/userguide.html#using-the-pytest-plugin https://typeguard.readthedocs.io/en/latest/userguide.html#us...
- BerislavLopac 6y agoI'm not sure what do you mean by "type-hint to an object that doesn't exist"? The objects are not type-hinted; variables are. A variable in Python will always have a value (because it's just a label on a value, not a container), and that value will always be an object, and objects in Python always have a type. If you mean that you are passing a variable that can have a value of None, this is what Optional[<type>] is for... Or maybe I'm missing something -- can you give an example?
- wodenokoto 6y agoimport numpy as np def f(x:numpy.array): pass Since numpy doesn’t exist in my namespace I get a runtime error (NameError) for a part of my code that supposedly isn’t used. I just feel like this should throw errors when running mypy and not when running my script.
- pmontra 6y agoSubscription required. We can check this instead: What’s New In Python 3.9 https://docs.python.org/3.9/whatsnew/3.9.html https://docs.python.org/3.9/whatsnew/3.9.html
- rich_sasha 6y agoPerhaps it is just about the features I personally use, but I find generally Python releases are mostly cosmetic. Big changes are included, but don’t drive the changes. 2 -> 3 was mostly about Unicode and print being a function. There was a ton of operational improvements, but none of them were breaking changes that warranted a change. Type hints are cute, but as other remarked, they are glorified comments. Mypy worked without them in 2.x . Not saying it’s bad to have them, but that it is cosmetic. From my point of view, the major improvements are on side tracks: - multicore support via sub interpreters (multiprocessing et al is clumsy and awful on Windows) - some modicum of static safety; like constants and declaring new variables to help with typos. You might say that these don’t fit in with Python, but I disagree. It would genuinely be a better language, in particular for its current use cases. But no, Unicode and fancier comments / annotations it is.
- orf 6y ago> Type hints are cute, but as other remarked, they are glorified comments. Mypy worked without them in 2.x . Not saying it’s bad to have them, but that it is cosmetic. That’s underselling them. They are definitely more than glorified comments and have unlocked a bunch of cool things like data classes and typed dispatch, as well as making a generally big impact on the ecosystem. Mypy worked around not having them in 2.x with what amounted to a hack, which nobody seriously liked using for a number of reasons.
- rich_sasha 6y agoI'm certainly glad they are there. It's a better language with them. My point is, they are really just syntactic sugar. Leaving mypy aside, attrs works perfectly well without annotations, and frankly I find it more powerful than dataclasses anyway. As I said before, maybe it is just that my use-cases are so different to others' (data science vs. web etc.). But Python is screaming for proper multicore support, better static safety, and presumably other things too. Instead we get niceties. And yes, of course, it's free, and it's great, and I'm not a contributor (not really in a position to contribute). So I'm not complaining. But also I gained next to nothing from upgrading from 2.7 to 3, and would gain nothing from going up the 3.x ladder. So it's hard for me to whip up enthusiasm about another version of type annotation goodness.