r/Python • u/japaget • Aug 06 '26
News Python 3.14.7 and 3.13.15 are now available!
Bug fix releases for Python 3.13 and Python 3.14.
r/Python • u/japaget • Aug 06 '26
Bug fix releases for Python 3.13 and Python 3.14.
r/Python • u/AngleHam271 • Aug 06 '26
We all know and love the big third-party libraries for automation and data, but I am curious about your favorite hidden gems right in the standard library. 🤔
Recently I have been leaning on things like itertools and collections way more than I used to...
What is a standard library module that you think is heavily underrated or that you use daily for your tasks?
r/Python • u/tiangolo • Aug 06 '26
Hello folks!
We're organizing the first ever official FastAPI Conf, in Amsterdam, October 28th, 2026. ✨
It's gonna be very cool, great speakers, and announcements too.
Early Bird tickets are now available (until August 23th).
Here's the website with info, tickets, and newsletter: https://fastapiconf.com
r/Python • u/BeamMeUpBiscotti • Aug 06 '26
This is an annual survey developed by the Python typing community around how Python developers use the type system, type checkers, and integrated development environments (IDEs).
Your responses will help us identify common blockers, improve tooling/resources, and enhance the overall experience of using Python's type system.
Even if you have never actively used type hints in your code, your thoughts are still valuable and we want to hear from you.
The survey should take approximately 5-10 minutes to complete.
Please take the survey HERE and share it with your friends or colleagues.
If you're interested in the results for last year's survey, see this post.
So you know it's legit, the Python Software Foundation has shared this survey on Linkedin and X. I have permission from the mods to post this under the "News" flair
r/Python • u/AutoModerator • Aug 06 '26
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
Let's help each other grow in our careers and education. Happy discussing! 🌟
r/Python • u/aviedawn • Aug 05 '26
what are teams actually running 3 months after the supply chain attack?
it's been a few months since the litellm pypi compromise and curious what teams actually migrated to. saw a lot of threads right after the incident but not much on how things held up in production since then.
been evaluating options ourselves. TrueFoundry came up for teams needing the governance and cost...
r/Python • u/M4mb0 • Aug 05 '26
For me, a prime example is S101 which bans the use of the assert statement.
The justification is that assertions disappear when Python is run with -O, so they should not be used for runtime validation or enforcing interface constraints. That warning is correct, but the rule seems to draw the wrong conclusion from it.
Assertions are still very useful for checking internal invariants, i.e. conditions that should already be guaranteed by the program's logic, where failure indicates a bug. Having such assertions is incredibly helpful for debugging.
So, a blanket ban seems more likely to discourage useful checks than to prevent misuse.
Are there any linter rules you broadly consider more harmful rather than helpful?
r/Python • u/AutoModerator • Aug 04 '26
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
r/Python • u/Prime_Director • Aug 04 '26
I’ve always hated environment management. It always feels like this time-consuming hurdle between me and whatever I actually want to work on. But every so often a new thing comes out that promises to solve the problem once and for all, and it’s usually at least a little better than the last thing. So, what are you using today? venv? conda? pipenv? poetry? dev containers? uv? or something else?
r/Python • u/ForeignVariety7037 • Aug 04 '26
I always thought the walrus operator is neat and it makes while loop’s condition clearer. But also it is just a syntactic sugar without anything new. I wonder anyone uses it?
r/Python • u/AutoModerator • Aug 04 '26
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
Let's deepen our Python knowledge together. Happy coding! 🌟
r/Python • u/Ill_Campaign294 • Aug 03 '26
Quick question, are any of you running fastAPI in production with a high volume of users or heavy traffic? How has your experience with FastAPI been, and how do you handle it?
r/Python • u/AutoModerator • Aug 03 '26
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
Difficulty: Intermediate
Tech Stack: Python, NLP, Flask/FastAPI/Litestar
Description: Create a chatbot that can answer FAQs for a website.
Resources: Building a Chatbot with Python
Difficulty: Beginner
Tech Stack: HTML, CSS, JavaScript, API
Description: Build a dashboard that displays real-time weather information using a weather API.
Resources: Weather API Tutorial
Difficulty: Beginner
Tech Stack: Python, File I/O
Description: Create a script that organizes files in a directory into sub-folders based on file type.
Resources: Automate the Boring Stuff: Organizing Files
Let's help each other grow. Happy coding! 🌟
r/Python • u/AutoModerator • Aug 02 '26
Hello r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!
Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟
r/Python • u/Voxelith3D • Aug 01 '26
If someone adds a new function to the code six months later, they would be unaware of the rule and nothing will complain because code will still work and tests will pass. Linters will not help here because these are not style rules, but project-specific invariants. "All user-visible strings must go through translation." "This whitelist must match what is stated in the privacy documents." A linter does not know what your translation is. Therefore, create tests that check the code:
=
=
assert not , f
That's the whole pattern. Everything below is just violates().
Example 1: no untranslated UI strings
Every string the user sees should come from t("some.key"), never a literal. Easy to enforce, easy to forget.
=
"""(lineno, text) for every literal passed straight into a UI setter."""
=
continue
continue
return
self.btn.setText(t("btn.save")) is not reported, since the argument is a Call and not a Constant. self.lbl.setText("Save changes") is reported.
This one revealed the bug to me which unit tests could never see, that is, a warning message that had been completely developed, correct, and tested for the application, but only in one language out of the six ones that were supposed to be used.
Example 2: make the naming convention be the rule
This is the one I'd actually argue for. Say you have a dict of operations that cost the user money:
=
The naive guardian compares the dict against a known-good copy of itself, which is self-defeating because you are only claiming that the list equals the list, and whoever adds an entry just updates both places.
Instead do it by coding the rule into the name where everything that one can bill is cloud_* and the guardian does only the check for the prefix without checking for what follows.
=
continue
continue
return
The guardian now applies even when operations are not yet present. Usage of "local_export": 2 does not work. Billing something local would force you to name it cloud_export instead — a lie simple enough for a human reviewer to catch.
The overall point is to use the naming scheme that would allow for the rule to be checked automatically as the test checks the property instead of the exact data.
Example 3: a constant that will not deviate from the document
You state in your privacy statement that these exact fields will be collected. The information is coded elsewhere. The latter will inevitably differ, not because anyone did anything wrong, but more likely because of an ordinary Tuesday afternoon.
return
return
return
Then assert both directions:
assert ==
Both directions matters. One direction catches "we collect something undocumented" - the compliance problem. The other catches "we document something we no longer collect" - the trust problem, and the one people forget.
When this is the wrong tool:
The niche is narrow but real: project-specific structural invariants that no off-the-shelf tool knows about.
Two gotchas that bit me:
Make a guardian that finds nothing loudly report that it found nothing. A typo in the path means it's not scanning any files, and silently succeeding. Assert that you scanned a reasonable number of files, or that the one known-bad fixture is indeed being caught by the guardian. A guardian nobody runs is not a guardian at all, and one that scans zero files is even worse than that, because it reports success.
Do not have a comment-based disablement of checks. I had a case where writing a comment in a certain way caused the line to be ignored, and it was propagated around the codebase. If a check needs exceptions, list them in the test as paths to scan, so that adding a new exception is visible in the git diff.
Curious if anyone else does something similar, and what they tend to check. The only somewhat similar thing I've seen in the wild is import-linter with rules for layering, which is more or less the same idea but for a narrower class of checks.
r/Python • u/Leyper • Aug 01 '26
I wrote a practical guide to Celery, a distributed task queue for Python. It starts with the basics and then covers recipes for timeouts, retries, async/await integration, and more. Most of these recipes came from problems I ran into while using Celery in actual projects. No prior knowledge of Celery is required.
I'd really appreciate any feedback!
r/Python • u/Pleasant-Aardvark258 • Aug 01 '26
Had this discussion the other day and figured I’d throw it to the masses to get thoughts on the best/most pythonic way of approach.
Need to map old column names to new column names as a copy from a json config.
My thoughts are iterate over a dict with
‘’’ {“old_col_name”:”new_col_name”}’’’
And access as
‘’’for k,v in dict.items()
Df.with_columns(k).alias(v)’’’
Colleague things this isn’t clear enough and should be a list of dicts with explicit keys
‘’’ [{“old_col_name”:”old_col_value”
“New_col_name”:”new_col_value”}]’’’
And the access as
‘’’for dict in list_of_dicts:
Old_col = dict[“old_col_name”]
New_col = dict[“new_col_name”]’’’
I’ve got a good few reasons why I think mine is the better option but thought I’d get some other opinions to see if I’m missing anything obvious? Which would you choose and why?
Edit: shouldn’t write these things while on the toilet in a rush. The description is wrong, it should be renaming via a copy so that the original column is left unchanged.
r/Python • u/AutoModerator • Aug 01 '26
Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!
Share the knowledge, enrich the community. Happy learning! 🌟
r/Python • u/poppy_92 • Jul 31 '26
https://peps.python.org/pep-0842/
Not the author, but this seems interesting, specially for library authors. Thoughts?
Discussion here - https://discuss.python.org/t/pep-842-module-exports/108353
r/Python • u/ichard26 • Jul 31 '26
Hello!
The pip team recently released pip 26.2. This release is quite large, with features such as:
--only-deps)--no-require-hashes--use-feature=venv-isolation)HTTP(S)_PROXY and similar non-pip specific proxy environment variables via --no-proxy-env--build-constraint instead)For more details, please consult our changelog: https://pip.pypa.io/en/stable/news/. Alternatively, you may consult my release post which goes into greater detail to the highlights of this release: https://sichard.ca/blog/2026/07/whats-new-in-pip-26.2/
If you have any questions, you're welcome to ask!
r/Python
•
u/zsol
•
Jul 31 '26
We recently released wheels.astral.sh, which is a repository of gpu-enabled wheels of popular packages from the pytorch ecosystem. These are useful because building them is super annoying - you have to align versions of pytorch, cuda, python, etc.
The pre-built wheels were part of the package of pyx, our paid service, and was a major reason many customers subscribed. We decided to open source the build pipelines and host the wheels for free while we sunset the rest of pyx.
The pipelines are available under the astral-sh-build github organization.
While these plug a genuine UX hole around cuda/pytorch wheels, we hope that wheel variants (PEP 817 and 825) will get accepted and implemented soon, which will let these pytorch wheels be hosted properly on PyPI and "just work" out of the box for everyone, making wheels.astral.sh obsolete.
Fingers crossed.
r/Python • u/AutoModerator • Jul 31 '26
Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!
Let's keep the conversation going. Happy discussing! 🌟
r/Python • u/ernestrc • Jul 30 '26
Author here. This is a nine-year account of building Rune, a new IDE (1.1 added support for Python). It started when my Vim's go-to-definition broke in 2017 and I decided to build my own editor rather than adopt an IDE: https://rune.build/blog/the-rise-of-the-command-line
r/Python • u/nathan12343 • Jul 30 '26
NumPy is the foundational array library in the scientific Python ecosystem. Every numerical, machine learning, and data analysis library in Python either depends on NumPy directly or interoperates with it. As the free-threaded build of CPython matures, NumPy is one of the first libraries that users reach for when trying to scale CPU-bound numerical workloads across multiple cores using threads.
In this blog post, I will walk through the work I did over the last few months in both NumPy and CPython to eliminate the multi-threaded scaling bottlenecks that were preventing NumPy from scaling on free-threaded Python.
https://labs.quansight.org/blog/scaling-numpy-on-free-threaded-python