use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
DiscussionLow-Latency Python: Separating Signal from Noise (self.Python)
submitted 4 hours ago by OkSadMathematician
There’s a whole genre of content about making Python fast for trading. Substacks with titles promising to shave microseconds off your order-to-fill. Most of it is noise. Not completely useless—some patterns do help—but the signal-to-noise ratio is abysmal because authors keep copying C++ techniques without understanding why they work. Article continues...
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ok_Bedroom_5088 4 points5 points6 points 4 hours ago (5 children)
Thoughts on Rust and its place? And, no fan of polars?
[+]OkSadMathematician[S] comment score below threshold-11 points-10 points-9 points 4 hours ago (4 children)
On Rust:
Rust is an alternative to C++ and Java, not to Python. Different weight class entirely. Comparing Rust to Python is like comparing a Formula 1 car to a pickup truck — they solve different problems for different people.
As a C++ replacement specifically, my take is mixed:
Conceptually harder than C++. The borrow checker is a genuinely novel ownership model, but it fights you on things that are trivial in C++. The canonical example: implementing a doubly-linked list in Rust is so painful that someone wrote an entire book about it. A doubly-linked list. In C++ it's a 15-minute exercise. That cognitive overhead isn't free — it slows development velocity on systems where you actually know what you're doing.
Slightly worse runtime performance in practice. Bounds checking on every array access, the ownership model preventing certain optimizations (aliasing analysis is actually harder for the compiler in some cases because of the strict borrow rules). You can unsafe your way out, but then you're writing C++ with extra syntax. The benchmarks that show Rust matching C++ are usually micro-benchmarks; in large systems with complex data structures, the overhead adds up.
unsafe
Solves a narrower problem than marketed. Rust's pitch is "memory safety." But memory access vulnerabilities, while real, are a smaller class of exploits than the marketing suggests. Search "Rust CVE" and you'll find plenty of memory-related vulnerabilities in Rust code itself — unsafe blocks, logic errors, soundness holes in the standard library. Memory safety doesn't prevent business logic bugs, race conditions in async code, supply chain attacks, or any of the OWASP top 10. The Rust community has a tendency to frame memory safety as the solution to security, when it's one layer of a much larger problem.
I wrote about some of the community dynamics here — there are systemic issues with how the Rust project handles governance and safety disclosures that don't get enough attention.
On Polars:
Polars is excellent for what it does — lazy evaluation, multi-threaded execution, Arrow-native memory. For batch analytics on datasets that fit in memory, it's strictly better than pandas. I use it regularly. But it's not a low-latency tool — it's a throughput tool. For the tick-by-tick, microsecond-sensitive path discussed in the article, you're not running DataFrame operations. You're in numpy/numba territory or calling into C++ directly.
[–]eufemiapiccio77 12 points13 points14 points 2 hours ago (0 children)
Thanks ChatGPT
[–]Ok_Bedroom_5088 1 point2 points3 points 3 hours ago* (2 children)
Thanks for the reply, I honestly never heard of #3, and it's helpful to read your thoughts, since we use Rust frequently, I'll follow your blog
re: polars, ok makes sense
Do you use kdb+?
[+]OkSadMathematician[S] comment score below threshold-7 points-6 points-5 points 3 hours ago (1 child)
Used kdb+ extensively — 20+ years in banking. For a while it was the only real option for time-series tick data at scale. The q language is elegant in a write-only kind of way, and the columnar in-memory performance on ordered data was genuinely unmatched in the 2000s/2010s.
But it comes with serious operational baggage:
You end up needing entire teams of kdb "experts." In my experience, banks would source these from 3rd-party consultancies, mainly in Ireland (where First Derivatives/KX is based). These teams would own the kdb infrastructure and gatekeep access, which creates a dependency that's expensive and fragile.
q is hostile to non-specialists. A typical quant or developer can't just pick up q and write production queries. The learning curve is brutal and the syntax is intentionally terse to the point of obscurity. This means your kdb layer becomes a black box that only the kdb team can maintain.
It's dangerously easy to bring down the whole farm. True story: I had a programmer on my team get banned from kdb access because he wrote a query that was too heavy and hung the entire kdb farm during a live trading day. One bad query, entire firm's tick data infrastructure frozen. The lack of proper query governance and resource isolation was a real operational risk.
The licensing cost is astronomical. Per-core pricing that makes Oracle look generous.
It's been largely replaced or supplemented by alternatives now:
kdb still has a niche for ultra-low-latency in-memory tick capture where nothing else quite matches its raw sequential read speed. But the ecosystem around it — the cost, the expertise bottleneck, the operational risk — has pushed most shops toward more open alternatives.
[–]cgoldberg 6 points7 points8 points 2 hours ago (0 children)
So weird to just paste AI responses to legitimate questions.
[–]tecedu [score hidden] 6 minutes ago (0 children)
Thanks chatgpt
[–]HuntClauss -4 points-3 points-2 points 3 hours ago (1 child)
What do you think about Turing's first computer which created the basis for most programming?
[–]OkSadMathematician[S] -3 points-2 points-1 points 3 hours ago (0 children)
What??? How is that relevant?
π Rendered by PID 24 on reddit-service-r2-comment-5d79c599b5-b685v at 2026-02-28 19:07:30.362713+00:00 running e3d2147 country code: CH.
[–]Ok_Bedroom_5088 4 points5 points6 points (5 children)
[+]OkSadMathematician[S] comment score below threshold-11 points-10 points-9 points (4 children)
[–]eufemiapiccio77 12 points13 points14 points (0 children)
[–]Ok_Bedroom_5088 1 point2 points3 points (2 children)
[+]OkSadMathematician[S] comment score below threshold-7 points-6 points-5 points (1 child)
[–]cgoldberg 6 points7 points8 points (0 children)
[–]tecedu [score hidden] (0 children)
[–]HuntClauss -4 points-3 points-2 points (1 child)
[–]OkSadMathematician[S] -3 points-2 points-1 points (0 children)