This reminds me of a Flask mini project I did. I was doing it in Ubuntu (LTS if I'm not mistaken). I picked python3 and ran with it. As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. I just reinstalled Ubuntu this week so I might give it another shot, but every time I try to do something with Python I end up with a broken mess, and that's disheartening
> As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. What do you mean? virtualenv exists exactly so that your libs are installed in your local directory and not globally in the system. I'm not sure how it could result in broken mess in the system that way.
Python 2.x vs. 3.x use survey
41–50 of 72 posts
Re: Python 2.x vs. 3.x use survey
#42This reminds me of a Flask mini project I did. I was doing it in Ubuntu (LTS if I'm not mistaken). I picked python3 and ran with it. As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. I just reinstalled Ubuntu this week so I might give it another shot, but every time I try to do something with Python I end up with a broken mess, and that's disheartening
AFAIK -mvenv is still kaput in Ubuntu. I just this instead: sudo apt-get install python-virtualenv python3 virtualenv -p/usr/bin/python3 Yes, it'd be way cooler if -mvenv wasn't crippled in Ubuntu, but this still works fine.
Re: Python 2.x vs. 3.x use survey
#43Re: Python 2.x vs. 3.x use survey
#44App Engine supports Python 2.7. this was a deal breaker for python 3 usage for me.
Re: Python 2.x vs. 3.x use survey
#45I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job. I avoid the use of Python 2 in every situation I can. Python 3 has better modules built-in; the existing modules have been cleaned up; a cleaned up language (no more xrange, lazy map/filter/reduce, explicit byte-stream encoding); an improved language (sub-generators); optional type annotations; configurable allo…
Re: Python 2.x vs. 3.x use survey
#46I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job. I avoid the use of Python 2 in every situation I can. Python 3 has better modules built-in; the existing modules have been cleaned up; a cleaned up language (no more xrange, lazy map/filter/reduce, explicit byte-stream encoding); an improved language (sub-generators); optional type annotations; configurable allo…
As one of those crazy functional programmers who uses python, can you please explain to me what the benefit is in remove xrange, lazy map/filter/reduce, and other functional mainstays in exchange for what is essentially more syntax to do the same?
Same applies to map, filter and I believe reduce as well.
Re: Python 2.x vs. 3.x use survey
#47I write all of my side projects in Python 3.4. I only write 2.7 because I work on Openstack at my day job. I avoid the use of Python 2 in every situation I can. Python 3 has better modules built-in; the existing modules have been cleaned up; a cleaned up language (no more xrange, lazy map/filter/reduce, explicit byte-stream encoding); an improved language (sub-generators); optional type annotations; configurable allo…
As one of those crazy functional programmers who uses python, can you please explain to me what the benefit is in remove xrange, lazy map/filter/reduce, and other functional mainstays in exchange for what is essentially more syntax to do the same?
>>> map(lambda i:i*i, range(5))
and have to explicitly construct a list: >>> list(map(lambda i:i*i, range(5)))
[0, 1, 4, 9, 16]
>>>Re: Python 2.x vs. 3.x use survey
#48Re: Python 2.x vs. 3.x use survey
#49This reminds me of a Flask mini project I did. I was doing it in Ubuntu (LTS if I'm not mistaken). I picked python3 and ran with it. As I tried to use Python's virtualenv (venv), I went down the rabbit hole of a broken mess that was left in Ubuntu. I just reinstalled Ubuntu this week so I might give it another shot, but every time I try to do something with Python I end up with a broken mess, and that's disheartening
AFAIK -mvenv is still kaput in Ubuntu. I just this instead: sudo apt-get install python-virtualenv python3 virtualenv -p/usr/bin/python3 Yes, it'd be way cooler if -mvenv wasn't crippled in Ubuntu, but this still works fine.
The issue seems to rise from a missing ensurepip module. I fixed this by just downloading the Python 3.4 sources, unpacking them and copying the unpacked lib/ensurepip/ to /usr/lib/python3.4/ after which python3 -m venv seems to work fine.
Re: Python 2.x vs. 3.x use survey
#50I have moved to Python 3 purely because of asyncio. There is no other reason that I have found Python 3 to be compelling for. When I write Python 3 now, I feel like my favourite language has gone all "serious" on me, like it wanted to grow up, and has lost a lot of its charisma on the way. I actually liked the print operator for example - it's probably the reason I chose python in the first place when I saw
>>> print "hello world"
for the first time. That's it? So clear and simple!3.0 has lost some of that. The unicode thing is also just irritating because 99% of the time ascii works very well and is less complicated, thank you very much.
Also, no matter what anybody says, you still bump into libraries that you need that are 2.x only (in my case Bloomberg). It doesn't matter if most libraries are ported if just one library that you need is not ported yet, you're back to 2.x. Imagine you're an average coder who uses say 8 libraries. By the ratio of 15% not yet moved, you're almost certain to have a problem (1 - 0.85 ^ 8 > 70% chance). Anyway I have been able to manage because I have isolated the 2.x dependencies in another system, and I have put in the effort only because I really like asyncio, and it's finally clear to me that Python 2.x has no future. That said, and taking that logic even further, the very fact that this 2v3 issue is still around is irritating, and has been irritating a lot of people for a long time. I am wondering about going the whole way and moving to another language altogether (Golang and/or functionals).
One more thing to point out. If you're beginning in Python, the vast majority of code samples on the internet are 2.x. That's fine if you have any clue about Python as the surface differences are not that large, but it is definitely a pain if you're expecting to copy and paste and have things "just work".