4 ms·
Due to the pain that concurrency is in Python, the codebases I've seen mostly shared data only via external processes (queues, databases). I was very surprised
by krab 4y ago
Due to the pain that concurrency is in Python, the codebases I've seen mostly shared data only via external processes (queues, databases).
I was very surprised to read the article. I think in the code I have in mind the borrow checker would only add overhead.
The most frequent errors I see in the Python webapp code are: 1. logic errors, especially around concurrent DB transactions, 2. type errors (missing values, improperly modeled data), 3. performance problems.
- rowanG077 4y agoIt's not only threads. It's also explicit in whether a function can modify an argument because it's type signature says this with the mut keyword.
- krab 4y agoYou're right. It just doesn't seem to create much issues in the application code I have experience with.
- s17n 4y agoWell the article is about writing a database, which is definitely going to need concurrency and communication via shared memory to deliver the performance that it needs to (which is why the original implementation was mostly C++ and the new one is Rust). But yeah, I think in general if you're running into issues with mutability in Python, you're either using Python for something it should not be used for, or you're just programming in a really weird way.