8 ms·
Weird how suddenly everyone seems to have coalesced around 3.5. I myself have experienced this just recently -- the new async stuff is too nice to pass up. Real
by hyperbovine 10y ago
Weird how suddenly everyone seems to have coalesced around 3.5. I myself have experienced this just recently -- the new async stuff is too nice to pass up. Really looking forward to new formatted string literals in 3.6 as well! One of those ideas that's so obvious in hindsight, you can't believe it took us this long to come up with it.
- plorkyeran 10y agoOne of the arguments against switching to Python 3 has always been that you just don't gain enough to justify the hassle, so maybe 3.5 finally hit that critical mass of things people really want.
- StavrosK 10y agoDon't gain enough? Static type checking and asyncio? Sign me up!
- pinaraf 10y agoStatic checking ? Python 3.5 Asyncio ? Python 3.4 If these had been available in Python 3.2 or even better 3.0, the switch would have been far easier for corporate users that need benefits before accepting the cost of change...
- raverbashing 10y ago3.4. gave a good virtualenv by default. That helps a lot
- brianwawok 10y agoI still use normal virtualenv, what am I missing by not using pyenv?
- raverbashing 10y ago3.4 gave us pip installed by default https://docs.python.org/3/library/venv.html https://docs.python.org/3/library/venv.html Before that it would give you an empty venv, not even setuptools Yes, you can use the Python 2 virtualenv on Py 3 but I remember that there were some problems
- takeda 10y agoThe usage is essentially the same, just a different command. Huge benefit though is that if you have Python 3.4+ installed you already have the virtual env and pip installed, so things are much simpler.
- StavrosK 10y agoWhich one is that? I'm not aware of it.
- captainmuon 10y agopython -m venv I'm not sure what the differences are to old virtualenv, but the biggest feature is that it works out of the box as long as you have Python > 3.4. No more googling "how to install virtualenv" or "easy_install pip; pip install virtualenv" stuff.
- rspeer 10y agoUnless you're on Ubuntu, where they ship a non-functional version of venv and require you to "sudo apt install" python-venv to get the working version, defeating the entire point of a simple module in the stdlib that lets you manage your Python environment as a user. The big improvement on 16.04 is at least the error message explains what's going on.
- brettcannon 10y agoThe venv module in the stdlib: https://docs.python.org/3/library/venv.html#module-venv https://docs.python.org/3/library/venv.html#module-venv
- takeda 10y agoin addition to what other wrote you also have pyvenv command which is much convenient way of using it in cli (the usage is same as of virtualenv).
- 912312312 10y agoI would say: Optional type checking outsourced to a third party tool (mypy) that catches perhaps 90% of the errors if you are lucky.
- eeZi 10y agoYou still need something like MyPy to actually validate types. What happened is that there's now a standard for typing annotations - now, PyCharm, MyPy, Wing IDE and anyone else can share the same syntax.
- yeukhon 10y agoI am disappointed in Python core developers when they decided to accept static typing to Python 3. It bothers me more than the formatting PEP.
- twblalock 10y agoIt's optional. How can that possibly bother you? Don't use it if you don't like it.
- xapata 10y agoBecause I'll need to support people that use it and explain it to newbies who read it. More work to do, without much benefit (to me; I understand it has much benefit to some people).
- StavrosK 10y agoIt's only without benefit if you don't write Python. Otherwise, it's like having tests that take almost no effort to write. What's not to love about it?
- xapata 10y agoEdward Tufte might call it chart junk. It reduces the information to ink ratio. I generally get by just fine by choosing good names, so I don't need extra type checking beyond the standard duck typing.
- catdog 10y agoIt's not only optional, it does nothing by default. What was introduced into python is a standardized way to do type annotations. It consists mostly of a new standard library module and as far as i know it doesn't even introduce changes to the language as it uses comments, additional files and the rarely used function annotations. The interpreter happily ignores them anyways but external tools like mypy don't have to invent their own incompatible syntax.
- kbenson 10y ago> One of those ideas that's so obvious in hindsight, you can't believe it took us this long to come up with it. If by "come up with" you mean finally acquiesced after decades and decided that string interpolation wasn't such a bad idea... sure.
- StavrosK 10y agoWhat's the difference between `"%s" % foo` and `"{}".format(foo)`? Why is one interpolation and the other not?
- nemetroid 10y agoPython 3.6 is adding `f"{foo}"`, which is rather different than the previous offerings.
- kbenson 10y agoYes, but to clarify, it's only rather different than previous python offerings. There exist things more or less equivalent in other languages, so it's not as if there's much of a reason it took this long.
- nilved 10y agoWow that is horrible.
- deleted 10y ago[deleted]
- allendoerfer 10y agoI really hate the fact that there are now 3 ways to do it. And that it looks like PHP. To be honest, to me the "%" seems the most pythonic way to do it. Format does not seem easier to understand to me . String formatting just cannot be transformed to natural language. I at least don't think "I need to format this string", I think "this variable needs to be in there", in the in there might as well be called "%". I think ["a is %s" % a for a in all_as] just fits. Although named parameters are nicer with format. In no way should there be a third way to do it. Isn't that the basic principle of Python, to care about things like this? I mean this whole Python 3 problem was to a small extend caused by people rather having an incompatible syntax than two ways to print a string. Going through these troubles and then inflating the language with new syntax for the same thing seems like a waste.
- cs702 10y agoNot weird. This phenomenon is literally called a "tipping point," and it has been well documented in many different settings and disciplines. Example: https://en.wikipedia.org/wiki/Tipping_point_(sociology) https://en.wikipedia.org/wiki/Tipping_point_(sociology) We're at the tipping point between Python 2.7 and 3.x.
- Florin_Andrei 10y ago> Weird how suddenly everyone seems to have coalesced around 3.5 I wonder if v3.5 being included in Ubuntu 16.04 LTS has helped there a little.
- JustSomeNobody 10y agoI wouldn't think. Its more likely that 3.5 just hits all the right bullet points and people are excited about it.
- didip 10y agoTotally not weird at all. Users need very compelling reason to switch off any kind of platform. And usually one of the compelling reason is better performance. The reception towards Python 3 would have been very different had it launched with everything Python 3.5 currently have, more performant GIL, OrderedDict, decimal operations, the new asyncio, etc.
- zepolen 10y agoIt's been almost a decade, a lot of bugs, annoyances and slowness has been ironed out. Most important libraries are py3, which is a biggie, and py3 changes were backported via __future__ to py2 so you can easily begin getting used to the syntax in current apps. So now that you are used to using print("hello") instead of print "hello" and not having to use u'whatever' all over the place - it was a perfect time to experiment with toy apps in python 3, since they are mostly backward compatible with python 2 without all the 2to3 nonsense. Even ubuntu made it default. Which leads us to asyncio, the killer feature - people were prepped to move...but didn't have a really compelling reason to...until now.
- deleted 10y ago[deleted]
- ben_jones 10y agoI'll be impressed by the new async features when they abstract the manual declaration of the event_loop in ways similar to Elixir or Golang. That's still a very confusing part for me and I find it hard to implement async properly into my programs in such a way that it's worth the added complexity.