News for hackers. Stuff that matters.
Re:PyQt5 Tutorial: Create a Python GUI in 2018 by toyg on Tuesday September 25, 2018 @01:23PM (#18068378)
I'm using PyQt for a project right now, and overall it's a nice feeling as always. The model/view classes are great, once you get the hang of them. There are a lot of utilities for things like persistence and threading (but I wouldn't cross the streams with python threads), and it's all crossplatform and very mature by now, the only issues are usually around packaging. QML is also very powerful, but I'm usually happy with Designer -- I guess I'm old-school.

If you need some help with PyQt development, call me up, I'm cheap ;)

Re:PyQt5 Tutorial: Create a Python GUI in 2018 by blattimwind on Tuesday September 25, 2018 @02:56PM (#18069334)
> (but I wouldn't cross the streams with python threads)

You can't. Also keep in mind that Python's thread-local storage only works with the threading module threads, not Python threads created elsewhere (e.g. by the "outer" C++ application itself or by a QThread wrapper). It's really quite poorly implemented there IMHO.

Re:PyQt5 Tutorial: Create a Python GUI in 2018 by krferriter on Tuesday September 25, 2018 @03:22PM (#18069580)
The "threading" functionality in Python is a significant downside to the language. I don't know why they went with the idea that people don't need real threads like they can get in C/C++, Java, C#.
Re:PyQt5 Tutorial: Create a Python GUI in 2018 by kbutler on Wednesday September 26, 2018 @08:56AM (#18075419)
> I don't know why they went with the idea that people don't need real threads like they can get in C/C++, Java, C#

Well, for one reason, the choice for Python (or the implementation we now call CPython) was made when you couldn't get what you think of as "real threads" in C/C++, and Java and C# did not yet exist.

Like many engineering choices, there are tradeoffs. The choice to implement Python memory management with reference counting and thus a global interpreter lock was made in an era when garbage collection was much less advanced, when most C libraries were not thread safe, and multi-core CPUs were mainly large computer installations.

As the stack overflow post https://softwareengineering.stackexchange.com/questions/1868... describes, there are advantages to an interpreter lock.

Now you know why.

But the world has changed in ways that make the disadvantages much more prominent. Unfortunately, efforts to remove it have failed because they slow down single-thread performance (which remains quite important) or break backward compatibility, etc.

Re:PyQt5 Tutorial: Create a Python GUI in 2018 by blattimwind on Tuesday September 25, 2018 @03:32PM (#18069704)
Python threads are real (operating system) threads.

Note that the "threading" and "_threading" modules wrap thread creation and otherwise just use interpreter C APIs. Their design flaw is that they assume that they are the only ones using the interpreter API.

Re:PyQt5 Tutorial: Create a Python GUI in 2018 by detaro on Tuesday September 25, 2018 @03:36PM (#18069742)
I assume parent is referring to the GIL, which limits the performance benefits you get from threads.
Re:PyQt5 Tutorial: Create a Python GUI in 2018 by blattimwind on Tuesday September 25, 2018 @03:40PM (#18069788)
Oh I know, sometimes I just like being pedantic.