Live data from Hacker News

Python 3.5.0

python.org

111–120 of 165 posts

Re: Python 3.5.0

#111
post #57

I'd love to use Python 3. Alas, I work in the defense industry and am working on a new development project in Python 2.6. Why? Because that's the version that's already installed on the client's systems, and getting anything new installed is such a nightmare of Vogon-esque policies and procedures that I've learned not to even ask. I'm constantly having to hack around bugs in ancient versions of libraries that have be…

I went to 3.3 a while ago but reverted back to 2.7 because out of the 10 or so crucial libraries I needed, one was still on 2.7. Bloomberg. ( http://www.bloomberglabs.com/api/libraries/ ). That's what the people who talk about high percentages of libraries already ported to 3, miss. All you need is a single one not to be ported and the future stays on hold. I have taken to using the 3 syntax in 2.7 so that I am prepa…

The GitHub repo suggests there's been Python 3 support for a while: https://github.com/filmackay/blpapi-py

I've run into my fair share of Python 3 roadblocks, but you'd be surprised how far you can get by making a little noise and sending the occasional patch. Library authors are much more willing to prioritize Python 3 support if it looks like people actually need it :)

Re: Python 3.5.0

#112

Python somehow always manages to miss the mark. The new co-routine stuff is a good example. Who can explain to me how I return more than once from the same co-routine? That is what a co-routine is after all no?

Check any tutorial about it or even the relevant pep. It's explained in many places. In short:

    def some_co():
        yield 2
        yield 3

Re: Python 3.5.0

#113

Python somehow always manages to miss the mark. The new co-routine stuff is a good example. Who can explain to me how I return more than once from the same co-routine? That is what a co-routine is after all no?

The new coroutine stuff is really just syntactic sugar for "yield from", which has been around for a few versions now (and in turn is little more than syntactic sugar for "yield"ing repeatedly).

But you don't return more than once from a coroutine. You can suspend it as often as you like, and that's what "await" does.

Re: Python 3.5.0

#114
post #69

Earlier quoted context omitted.

Yep - can't wait until Python3 is the norm. Feels like such a step back when I have to use a Python 2.x codebase - so many little annoyances.

Join us in the future! I made python 3 a 'production readiness requirement' at the start of this year. My two biggest Python3 complaints have stopped being 'something doesn't work' to 1: Pyston is targeting Python 2 and 2: PyPy doesn't care enough about Python 3 ( I mean seriously... PyPy + AsyncIO = EPIC )

Pypy is accepting donations for 3. I encourage everyone that is interested to chip in a few bucks

Re: Python 3.5.0

#115
post #45
post #41

I've recently joined a Python project, my first time working with the language. We're currently using Python 2.7. How do experienced Pythonistas decide if/when to upgrade to 3.x? I figured it was a no brainer given that it has been 7 years with a number of big releases, but Flask's warning on this topic put me off: http://flask.pocoo.org/docs/0.10/python3/

Those flask docs look out of date. I don't think you'll hit those troubles in python 3 anymore. It's imo a very mature ecosystem now.

That's very out of date going by: "Python 3 currently has less than 1% of the users of Python 2 going by PyPI download stats." The web ui download starts stopped being updated in 2013 if I remember correctly and api was disabled shortly after due to migration to CDN. So these stats are ~2 years out of date.

Re: Python 3.5.0

#116

Earlier quoted context omitted.

If you're already working around bugs you could create your own venv with a later version. Easier to ask forgiveness than permission.

Not in the defence industry.

I work in the defense industry. Sometimes it is indeed easier to ask for forgiveness than permission, but you must be very careful. Obviously anything that violates any NDAs or security agreements is not to be pushed at all, but I've had no problems writing and running Python and MATLAB programs.

Point is, defense industry doesn't automatically equal a locked down environment.

Re: Python 3.5.0

#117

And yet, Python 2 usage is still strong while Python 3 adoption has actually slowed down , and at this rate, it will probably stop being used completely while Python 2 continues to live on: https://www.reddit.com/r/programming/comments/3k9yif/larry_w...

> Python 2 usage is still strong while Python 3 adoption has actually slowed down

Hypothesis: distributions started installing python3 by default now, so people don't have to download it separately anymore. Python 2 downloads will stay at the same level as they were and actually 2.6 will go up as it's not available in supported distributions anymore. This is strangely opposite trend to actual adoption.

Re: Python 3.5.0

#118
My experience:

I've tried Python 3 and enjoy it very much. A few things drove me nuts at first, trying to figure out why syntax that worked in Python2 is not longer working in Python3. But a little bit of googling and I was on my way with Python3.

I have a project that I started a long time ago in Python2 using web.py. I tried to migrate to Python3, but unfortunately, web.py is not supported. I know Flask has python3 support and I could migrate to that but I'm not ready to move my whole code base over yet.

From someone who tried to migrate to Python3 with no compelling reason to, hit a roadblock, I immediately shelved the problem till later as I'm not missing anything critical from Python3 to warrant the effort.

I wonder how many other projects go through this? Especially much larger, more complex code bases.

Re: Python 3.5.0

#119

Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support. Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

Pulsar[1] and pulsar-odm seem to be the python equivalent of akka-http. (Actor based concurrency and ORM[2])

[1] http://pythonhosted.org/pulsar/ [2] https://pypi.python.org/pypi/pulsar-odm

Re: Python 3.5.0

#120
post #107

Earlier quoted context omitted.

As someone who's bounced back and forth between Python 2 and Python 3, I'm curious about your need of parameter tuple unpacking[0]. I've never encountered it, and after some research I don't understand the use case. I don't mean to sound like I'm trying to belittle your position, I would like to understand more. The PEP below doesn't seem to do a very good job explaining why people like them, and I'd like to hear a p…

A good example of a use case I can think of would be to pass an (x,y) coordinate pair as a single parameter, and unpack it in the parameter definition. This would save having an extra line that says (x,y) = pt. Unless I'm missing something, I don't see this as a show stopper personally, and see it as increasing readability.

You should use a namedtuple for that sort of thing, and then refer to the members as pt.x and pt.y.
Post reply on HN