4 ms·
Speaking from the perspective of someone who doesn't code in Python: I recently considered doing so for a scientific computing task at work but quickly ditched
by Stubb 13y ago
Speaking from the perspective of someone who doesn't code in Python: I recently considered doing so for a scientific computing task at work but quickly ditched the notion. Python 3 seemed the recommended choice for a green-field project, but good luck getting anywhere with it due to poor library support. Want to access a MySQL database, generate 3-D graphics, or use someone else's code? Good luck with that! Python 3 may have been released five years ago, but uptake among developers appears negligible. So why not use v2.7? Several features in v3 looked appealing, and documentation makes it clear that v3 is the future. So I decided not to invest in a language that can't make up it's mind and stuck with R.
- Ixiaus 13y agoThis is unnecessarily pessimistic. Most of the major packages support Py3k and if they don't it's usually very simple to port over (it usually means combining 2to3 with some bytestring to string conversion debugging). I'm not in the scientific field so forgive me if I'm being parochial but I've been writing software in Py3k exclusively for a year and half now. Using scientific computing, distributed queue processing, webapp, CLI utilities, etc... [EDIT] Better words.
- Stubb 13y agoThe shocker for me was seeing that MySQL-python didn't support v3. And I recall all sorts of problems getting IPython 3 running in Emacs alongside the system version of Python 2. Porting a library to v3 was more than I was willing to bite off and a brand-new user when I had a customer deadline approaching.
- nknighthb 13y agoI haven't used MySQL-python in years. It's long bordered on being utterly unmaintained. Use oursql or pymysql.
- Aqwis 13y agoI was shocked by MySQL-python not supporting Python 3 as well, but then I discovered that there are several better alternatives to MySQL-python that do support it, such as pymysql. AFAIK it's 99% compatible with MySQL-python.
- dded 13y ago> This is unnecessarily pessimistic Remember, he's looking at using Python for the first time. I work in Perl-heavy environments, and I can assure you that the 2/3 split in Python is a reason that many will give for not using Python at all. It's very different among those who are already comfortable with Python. > Most of the major packages support Py3k and if they don't it's usually very simple to port over For you, maybe. He's just starting with Python. With regards to scientific Python, I took a peek at the install link on the Ipython site. It says that Ipython works with Python 2.6, 2.7, and >= 3.2. That was only mention I saw (in an admittedly casual look) for Python3. All the examples were in Python2.
- AgentConundrum 13y ago> the 2/3 split in Python is a reason that many will give for not using Python at all I don't know Python, but I've gone through a few phases where I'll play with it for a bit and then put it back down. (Incidentally, I appear to be entering a "play" phase right now.) I can't explain it exactly, but the 2/3 thing makes me really uneasy about learning the language. On one side, there is Python 2 which is supposed to die in the non-immediate future. I don't need to learn it, particularly since development isn't my primary career at the moment and I'm unlikely to "need" it before I inevitably switch careers back to dev. If I don't need it now, and I don't expect to be in a situation where I need it in the near future, why not go for Python 3 right away? On the other side, Python 3 is the new hotness, and it's the future of the language. It's the heir apparent. It's going to be "the" Python in the nearer-than-you-think future. But it doesn't seem ready. You get the impression that you'll start a greenfield project and then get to a point where you want to drop in a well-known component and you just won't be able to. You also look at the fact that it's been around for over half a decade yet 80% of of respondents to this survey say they use 2 more than 3, 40% have never touched it, and 20% say the whole thing was a bad idea. If you were walking into that environment, would you really be so quick to disregard it? I suppose the answer is to just learn it all and try to keep the differences in mind as you go, but it's understandable the a lot of people don't want to half to learn and semi-unlearn the same language all at once.
- aidos 13y ago
- pyre 13y ago> So I decided not to invest in a language that can't make up it's mind It's a bit unfair to try to group the actions of vast swaths of people under the same banner, and penalize them for not acting in concert. Why isn't the entire Python community using 100% Python3 right now? Because they are a disparate group of people with differing motivations and goals. It's only been in the last year that some major projects have started to support Python3 (e.g. Django). Not everyone has the luxury of spending all their time porting over existing code-bases to Python3 the moment that it's possible.
- Stubb 13y agoI've little doubt that the folks using Python are making the decisions that are right for them. The underlying problem that I saw in my survey was that Python 3 broke compatibility while not offering developers a compelling reason to update their code beyond it being the right thing to do. Hence, folks are taking their time doing so. Developing in Python also seems an either/or proposition: either you target v2 or v3. This puts library authors in the unenviable position of supporting two code bases.
- Finster 13y agoWhen choosing a language, the community is (almost) everything. If the community is divided and unwilling to support v3, that is more than enough reason to "penalize" them and not use the language.
- dcre 13y agoI use pyodbc[1] to connect to SQL Server from my Python 3 code and it works just fine. Does it not work well with MySQL? I couldn't find any indication of that in an admittedly cursory search. Are there advanced features you need that are outside ODBC's scope? I agree completely on the graphics side, though. Terrible. [1] https://code.google.com/p/pyodbc/ https://code.google.com/p/pyodbc/
- pwang 13y agoI wish more people in the dev community would ponder your experience and decision-making process. I don't think Python 3 was a mistake. I understand the reasons for doing it, and the difficult decision making process there. I also have tremendous confidence in core dev team and Guido to make the right decisions even if they are difficult. However, I think calling it Python-next or -NG or something non-numerical would have been better, and CLEARLY signalling that Python 2.x IS NOT DEAD. The big problem is that 3 is bigger than 2, and by advertising that 3 is not yet ready but 2 will no longer be supported, there is sort of an Osborne effect (http://en.wikipedia.org/wiki/Osborne_effect http://en.wikipedia.org/wiki/Osborne_effect) that is hurting adoption of Python 2 AND Python 3. "Python 3 is the future" but "Python 2 is also the immediate future", like for the next 3-4 years AT LEAST. My company is undoubtedly going to need to support it for well beyond that. There is no problem here. Python 2 evolved so much over its point revisions that the idioms in 2.7 for instance are vastly more concise and improved from 2.4. Would it have made sense for someone to not learn Python 2.4 just because eventually 2.7 would improve or deprecate some of the things they'd learned? Looking through the main python.org page through the eyes of a beginner, it's hard to find clear guidance on this. My company is squarely in the space of promoting the use of Python for scientific computing and data analysis, and it's difficult sometimes to get folks in the community to recognize the difficult job of ambassadorship to other languages, like R, Java, C#, etc. That being said, there is still tremendous adoption of Python for data and scientific purposes, so I'm not really worried. I'm just sad to hear that a potential newcomer was driven away by unclear messaging. (Especially to stick with R... <shudder> :-)
- steder 13y agoThere are actually several MySQL drivers and at least 2 worth using on Python2 and Python3: MySQL driver 1: http://pythonhosted.org/oursql/ http://pythonhosted.org/oursql/ MySQL driver 2: https://github.com/PyMySQL/PyMySQL https://github.com/PyMySQL/PyMySQL Both are well supported drivers. Much nicer to use than the old Python2 only MySQL-python driver, imo.