News for hackers. Stuff that matters.
Re:Removing Python 2.x support from Django for version 2.0 by stevehiehn on Thursday January 19, 2017 @04:16AM (#13434294)
Good. I've been getting into python a bit because i have an interest in datascience. I'm mostly a Java dev. I have to say the python2/3 divide is a real turn off. Many of the science libs want to use seem to be in 2.7 with no signs of moving.
Re:Removing Python 2.x support from Django for version 2.0 by joeyspn on Thursday January 19, 2017 @06:39AM (#13434982)
> Many of the science libs want to use seem to be in 2.7 with no signs of moving

The most important scientific libraries have pledged to drop support before 2020, and are all python3-ready

http://www.python3statement.org/

Re:Removing Python 2.x support from Django for version 2.0 by lmm on Thursday January 19, 2017 @06:50AM (#13435048)
Is there any hope of other libraries and OSes doing the same thing?

I used to work on a GUI app in Python. I ported it to Python 3, then switched OSes for various reasons. 5 years on, on Ubuntu Xenial (so new I can't even use it in Travis, but that's a separate whine), I install pykdeuic4 and it's using Python 2. So I've basically abandoned that project for 5 years now, because every time I looked at it I thought "surely Python 3 will be here in a few months, I don't want to port backwards to Python 2".

(Serious question: is there a PPA or anything I can use to get these things for Python 3? I need PyQwt as well as PyKDE)

Re:Removing Python 2.x support from Django for version 2.0 by xioxox on Thursday January 19, 2017 @08:12AM (#13435472)
Have you tried python3-pykde4? It seems to contain a pykdeuic4.py file.
Re:Removing Python 2.x support from Django for version 2.0 by lmm on Thursday January 19, 2017 @09:09AM (#13435830)
No - but you've set me on the right track, there looks to be a pykdeuic4-3.4 executable (I had assumed if there were anything like that it would be a case of update-alternatives, but apparently not?). Will try that when I get home.
Re:Removing Python 2.x support from Django for version 2.0 by StavrosK on Thursday January 19, 2017 @09:56AM (#13436226)
In general, I've found that Ubuntu versions of the last 1-2 years support Python 3 fine, you just have to use the "python3-*" packages.
Re:Removing Python 2.x support from Django for version 2.0 by lmm on Tuesday January 24, 2017 @09:21AM (#13471469)
Fair enough. E.g. I was assuming the reason PyQwt didn't exist for python3 was because Ubunty hadn't packaged it, but having looked further it seems the library itself is unmaintained.
Re:Removing Python 2.x support from Django for version 2.0 by rtpg on Thursday January 19, 2017 @07:53AM (#13435335)
I've had similar issues with most GUI libraries.

Seriously: if you can, try building your thing with tkinter. It's the standard lib, and will "work"

Re:Removing Python 2.x support from Django for version 2.0 by lmm on Thursday January 19, 2017 @08:04AM (#13435412)
I'm not going to port to tkinter. I like KDE, I like Qt Designer, and I have a working GUI. If tkinter is the only thing that works in Python I'll abandon the language (I mostly work in Scala these days anyway) and find one with working Qt bindings.
Re:Removing Python 2.x support from Django for version 2.0 by 72deluxe on Thursday January 19, 2017 @11:09AM (#13436836)
Just use C++ and your Qt bindings will never go away!
Re:Removing Python 2.x support from Django for version 2.0 by lmm on Thursday January 19, 2017 @11:28AM (#13437013)
Qt is a point in C++'s favour, but not enough to outweigh the downsides of the language.
Re:Removing Python 2.x support from Django for version 2.0 by 72deluxe on Wednesday January 25, 2017 @05:17AM (#13480209)
What! There are no downsides to the language! I jest

I love catching errors at compile time, not runtime :-)

Plus, it runs faster

Re:Removing Python 2.x support from Django for version 2.0 by lmm on Friday January 27, 2017 @08:59AM (#13499791)
I like catching errors at compile time. But C++'s unchecked manual memory management introduces more errors than the rest of the language eliminates, undefined behaviour turns all bugs into security bugs, there aren't first-class sum types (std::variant is finally on the way in but seems quite restricted; std::visit, while much better than what came before, is pretty cumbersome), and templates are cumbersome in syntax (and error reporting) and not as safe as they look thanks to partial specialization (which will be fixed by concepts if they ever actually make it into the language, but, well...). Along with plenty of less immediate problems (e.g. the lack of a module system).

If there were an ML-family language with good Qt support I'd use that for my GUIs - I use ML-based languages for almost all my non-GUI work. There's plenty I dislike about Python but it's still the best desktop GUI experience I've found.

Re:Removing Python 2.x support from Django for version 2.0 by flukus on Thursday January 19, 2017 @06:15PM (#13440356)
Could you write your UI in c++ with custom bindings and have the rest of the app in python?

Qt's binding support has been it's biggest issue since forever.

Re:Removing Python 2.x support from Django for version 2.0 by lmm on Friday January 20, 2017 @06:27AM (#13443039)
Maybe, but I like using Python for the GUI too. It was really nice back when it worked.
Re:Removing Python 2.x support from Django for version 2.0 by flukus on Saturday January 21, 2017 @05:56PM (#13452550)
A project you might be interested in is libui (https://github.com/andlabs/libui). I can't comment on it because I haven't used it and it's still quite young but it looks promising, it's on my radar to learn soon. Native widgets and written in c so the bindings should be stable. I've never written bindings for c++ but I'm guessing it's not easy because all the c++ toolkit bindings are unstable.

It has quite a few bindings already, here are the python ones: https://github.com/joaoventura/pylibui .

Re:Removing Python 2.x support from Django for version 2.0 by ma2rten on Thursday January 19, 2017 @10:58AM (#13436748)
The most important scientific libraries

Not numpy, scipy, tensorflow...

Re:Removing Python 2.x support from Django for version 2.0 by Chris2048 on Thursday January 19, 2017 @10:37AM (#13436567)
Is Numpy on that list?
Re:Removing Python 2.x support from Django for version 2.0 by kstrauser on Thursday January 19, 2017 @03:40PM (#13439270)
Yep:

  % python --version
  Python 3.5.2

  % pip install numpy
  Collecting numpy
      Using cached numpy-1.12.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
  Installing collected packages: numpy
  Successfully installed numpy-1.12.0
Re:Removing Python 2.x support from Django for version 2.0 by Chris2048 on Thursday January 19, 2017 @04:01PM (#13439453)
That are dropping Py2 support, I mean.
Re:Removing Python 2.x support from Django for version 2.0 by jaipilot747 on Thursday January 19, 2017 @04:19AM (#13434311)
Which libraries do you have in mind? Numpy, SciPy, Pandas and packages based off them all support Python 3.
Re:Removing Python 2.x support from Django for version 2.0 by stevehiehn on Thursday January 19, 2017 @04:25AM (#13434333)
It believe it was a digital signal processing library. I don't recall the name.
Re:Removing Python 2.x support from Django for version 2.0 by rbanffy on Thursday January 19, 2017 @07:45AM (#13435294)
You used the word "many"...
Re:Removing Python 2.x support from Django for version 2.0 by stevehiehn on Thursday January 19, 2017 @12:39PM (#13437607)
Ya, 'a few' is more accurate. I looked into pybrain which was 2.x. I understand that many people now use tensorflow. The point is it will be nice when more people normalize on 3. It did make me appreciate the backwards compatibility of Java.
Re:Removing Python 2.x support from Django for version 2.0 by viraptor on Thursday January 19, 2017 @04:18AM (#13434303)
At least the science libraries have a better reason for staying. They often require bigger fixes of the modules compiled from other languages. Still, it's good to see larger projects moving on.
Re:Removing Python 2.x support from Django for version 2.0 by sqrt28 on Thursday January 19, 2017 @07:44AM (#13435290)
I am data scientist who uses both pythons and the only lib I had issues with was the first release of tensorflow (and that was fixed very soon). Otherwise I find it hard to believe that there exist any maintained libraries that do not support both versions.
Re:Removing Python 2.x support from Django for version 2.0 by Analog24 on Thursday January 19, 2017 @08:24AM (#13435550)
I do a lot of data science/ML work and it is almost exclusively done with Python3 so I'm not sure what libraries you are referring to as I haven't had any issues.