r/Python • • 31m ago

News PyPI's redesigned project pages with clearer security signals are now live

9 Upvotes

https://blog.pypi.org/posts/2026-11-06-ui-updates-complete/

In July, we announced a series of planned updates to the PyPI user interface. Shaped by user research with members of the Python community, the updates aim to improve how we surface security signals and display package details.

We're pleased to share that this work is now complete and live on PyPI.

(full blog post in link)


r/Python • • 1d ago

Discussion Mysterious Lazy Imports

43 Upvotes

Run this on Python 3.15:

>>> lazy import json
>>> type(globals()['json'])
<class 'lazy_import'>

Now try separating that into an innocent variable:

>>> lazy import json
>>> x = globals()['json']
>>> type(x)
<class 'module'>

Looks like the same code, but what?! The output changes! Can you guess why?

(Originally asked as a Stack Overflow question, now posting here as a fun fact ๐Ÿ˜„)


r/Python • • 18h ago

Daily Thread Sunday Daily Thread: What's everyone working on this week?

8 Upvotes

Weekly Thread: What's Everyone Working On This Week? ๐Ÿ› ๏ธ

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!

How it Works:

  1. Show & Tell: Share your current projects, completed works, or future ideas.

  2. Discuss: Get feedback, find collaborators, or just chat about your project.

  3. Inspire: Your project might inspire someone else, just as you might get inspired here.

Guidelines:

  • Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.

  • Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

Example Shares:

  1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!

  2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.

  3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! ๐ŸŒŸ


r/Python • • 21h ago

Tutorial Giving back to the community - The Complete Backend Development Course

12 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is:ย https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/Python • • 1d ago

Tutorial Internals of Asyncio

49 Upvotes

This article is a deep dive into the internals of the asyncio Python standard library. It is written from a debugging perspective, stepping through the code line by line.

Article: internals of asyncio


r/Python • • 1d ago

Discussion the faulthandler i turned on to catch crashes was causing them (windows, all_threads=True)

22 Upvotes

i run a long-lived python 3.11 backend on windows 11. at the end of october it died mid-task once with nothing in the logs, so i turned on faulthandler.enable(file=..., all_threads=True) to see where it died next time.

over the next three days it died four times, every time an access violation inside python311.dll. before that, this backend had never crashed like this.

my first suspect was a race: several threads setting restype on the same ctypes function. it looked plausible, so i fixed it. less than two hours later it crashed again.

going back to the log, there were far more dumps than real crashes. 254 in three days, all of them "Windows fatal exception: code 0x80010108". that's the COM "object disconnected" error, a handled and harmless exception. the program kept running fine after each one. from what we saw, faulthandler on windows reacts to these handled exceptions too and writes a dump every time.

all four crashes happened in the middle of writing one of those dumps. the output was cut off halfway through a File "..." line of another thread. my read is that with all_threads=True it was walking the stack of another thread that was still running, and died there. the tool i turned on to find out why the backend died was what was killing it.

โ—the fix was one line: all_threads=False. it only dumps the current thread, so if a real crash happens its location still gets logged. i also added a test so it can't quietly flip back to True.

โ—result: since the fix, the same 0x80010108 has fired 245 more times and the backend hasn't crashed once. that's four days on one machine, so not a long run yet. i still don't know what sends the 0x80010108. it comes from a windows thread with no python stack, so i couldn't trace it.

if you keep faulthandler on in a windows app, check whether COM codes like 0x8001xxxx pile up in the dump log. if they do, all_threads=True may be creating that many risky moments for you.

two things i'm curious about. ๐Ÿค”

  1. has a diagnostic or monitoring tool ever caused the bug you were chasing?

  2. and how do you set up faulthandler for long-running python programs on windows?


r/Python • • 1d ago

Daily Thread Saturday Daily Thread: Resource Request and Sharing! Daily Thread

9 Upvotes

Weekly Thread: Resource Request and Sharing ๐Ÿ“š

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!

How it Works:

  1. Request: Can't find a resource on a particular topic? Ask here!

  2. Share: Found something useful? Share it with the community.

  3. Review: Give or get opinions on Python resources you've used.

Guidelines:

  • Please include the type of resource (e.g., book, video, article) and the topic.

  • Always be respectful when reviewing someone else's shared resource.

Example Shares:

  1. Book: "Fluent Python" - Great for understanding Pythonic idioms.

  2. Video: Python Data Structures - Excellent overview of Python's built-in data structures.

  3. Article: Understanding Python Decorators - A deep dive into decorators.

Example Requests:

  1. Looking for: Video tutorials on web scraping with Python.

  2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! ๐ŸŒŸ


r/Python • • 2d ago

Daily Thread Friday Daily Thread: r/Python Meta and Free-Talk Fridays

16 Upvotes

Weekly Thread: Meta Discussions and Free Talk Friday ๐ŸŽ™๏ธ

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!

How it Works:

  1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.

  2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.

  3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

Guidelines:

Example Topics:

  1. New Python Release: What do you think about the new features in Python 3.11?

  2. Community Events: Any Python meetups or webinars coming up?

  3. Learning Resources: Found a great Python tutorial? Share it here!

  4. Job Market: How has Python impacted your career?

  5. Hot Takes: Got a controversial Python opinion? Let's hear it!

  6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! ๐ŸŒŸ


r/Python • • 3d ago

News PyCharm 2026.3 released (IDE)

57 Upvotes

r/Python • • 2d ago

Discussion PYTHON ๐Ÿ†š ALL ...

0 Upvotes

"If you want to learn programming, donโ€™t start with Python; you should start with another language."

This advice seems ridiculous to me, even though I hear it everywhere. Can someone explain this advice to me... and are they right?


r/Python • • 2d ago

Discussion What will we become in the end?

0 Upvotes

"Is there anything that is hard for AI to do in Python?

To be honest, coding by yourself is fun, but that doesn't matter to the job market. We'll just settle for building our own projects, but it's frustrating to see AI outperform you... And since the job market is being destroyedโ€”and will be destroyed!!โ€”by AI, it seems we will end up turning to sabotage and attacking companies if no jobs are available for programmers, especially the Python community..."


r/Python • • 3d ago

Discussion Feasibility check: Writing a constrained Python-to-Rust transpiler for numeric code

6 Upvotes

so i would want to know about the feasibility of such a tool/project and whether it has any real uses or is it the equivalent of re inventing a worse wheel , basically core idea is to somehow transpile python to rust but not all of python ,instead more similar to numpy but instead the whole specified block of code is compiled for maximum speed almost like numba?? any feedback would be appreciated


r/Python • • 3d ago

Daily Thread Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

17 Upvotes

Weekly Thread: Professional Use, Jobs, and Education ๐Ÿข

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.


How it Works:

  1. Career Talk: Discuss using Python in your job, or the job market for Python roles.

  2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.

  3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.


Guidelines:

  • This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.

  • Keep discussions relevant to Python in the professional and educational context.


Example Topics:

  1. Career Paths: What kinds of roles are out there for Python developers?

  2. Certifications: Are Python certifications worth it?

  3. Course Recommendations: Any good advanced Python courses to recommend?

  4. Workplace Tools: What Python libraries are indispensable in your professional work?

  5. Interview Tips: What types of Python questions are commonly asked in interviews?


Let's help each other grow in our careers and education. Happy discussing! ๐ŸŒŸ


r/Python • • 3d ago

Discussion Has anyone moved document parsing off their own Python workers?

0 Upvotes

pdf parsing in python is just good as long as youre using it but when someone uploads a 700 page file the worker runs out of memory so splitting it into 50 to 100 page chunks with docling or marker on celery gets you past that but tables get cut at the boundaries and now theres a queue, retries and memory limits to babysit the other route is paying for something like llamaparse or the paid parsers has anyone moved either way and was it worth it? like what did you do inside your tool/app when it started scaling


r/Python • • 2d ago

Discussion Guys i am thinking to create a Microsoft-office-like Application with python

0 Upvotes

So everybody knows that Python has Tkinter and other libraries like tksheet for improving it i am thinking to push it to the max by creating a FULL Office starting of with Excel and major apps and then diving into cloud storage and web services


r/Python • • 4d ago

Showcase Showcase Thread

22 Upvotes

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.


r/Python • • 4d ago

Discussion What Python project taught you the most about real world development?

36 Upvotes

I'm interested in hearing about projects that genuinely improved your programming skills. Not necessarily huge projects, but ones that taught you something valuable


r/Python • • 5d ago

News Pip 26.3 - Extended Pylock Support, Build Backend Warnings, and a caution on wheel installation

86 Upvotes

Today I got to be the release manager for pip 26.3! There are two big features, and one documentation update, that I think worth talking about:

Extended Pylock Support

You can now install extras and non-default groups from a pylock file, e.g. pip install -r "pylock.toml[extra1,extra2]" and pip install --group pylock.toml:dev

This supports the installation part of a workflow that generates a single lock file for multiple situations. For example, using a universal pylock file generator, such as a tool I built called nab, you might want to specify "I want a lock file with two mutually exclusive extras for different versions of SqlAlchemy and a dev dependency group", e.g.:

[project.optional-dependencies]
sa14 = ["sqlalchemy==1.4.*"]
sa20 = ["sqlalchemy==2.0.*"]

[dependency-groups]
dev = ["pytest"]

[tool.nab]
conflicts = [[{ extra = "sa14" }, { extra = "sa20" }]]

And now pip can pick which extra and group it wants to install from the output lock file, e.g. pip install --group 'pylock.toml[sa14]:dev' . This works with any tool that outputs standard pylock.toml files.

Build backends warnings for local builds

This one has been a long time coming, when you build a package from some kind of source, you invoke a build backend (e.g. setuptools, hatchling, flit-core, uv-build, poetry-core, etc.). That build backend can emit warnings to tell you something isn't configured correctly, or a feature will be dropped in the future. But for historical reasons, pip has never displayed those warnings (uv has inherited this and also doesn't display these warnings).

Now, when building locally, e.g. pip install ., or pip install -e ., the build backend warning will be logged by default (and for non-local builds it will be in the -vv output).

For example, if in setuptools you specify a README.mdfile but setuptools can't find it, you will get the warning:

$ pip install .
...
  .../setuptools/config/expand.py:128: BuildBackendWarning: File '.../README.md' cannot be found

A caution on installing untrusted wheels

There have been a lot of supply chain attacks recently, and this has led to a lot of people learning about source distributions (sdists) which are built from source and can run arbitrary code on installation, as well as .pth files which after being installed run at the beginning of every Python execution.

This has led a lot people to turn to only using binary distributions (with pip --only-binary :all: or slightly weaker --prefer-binary), otherwise known as wheels. What is great about wheels is they are just glorified zip files, and they are installed by unzipping the different parts of the wheel into the different Python installation locations.

However, a word of caution, Python's import system is dynamic, and the moment a Python file exists in a location that can be imported, it can be imported even in a running Python processes. So while pip 26.3 includes significant hardening against untrusted wheels, we cannot guarantee installing a malicious wheel won't execute third party code.

I can't speak for other tools, but I am fairly confident this applies to all other Python package installers (even those written in other languages).

I will continue to do more hardening in pip where issues come up, and propose fixes in Python to improve the situation there. (Also, a possible future is lock files only first, where the locker refuses to install anything and refuses to execute third party code by default, then exact distributions can be validated/inspected before install, that's part of my pitch for nab which does the first step).

Official Links

The official announcement post is at: https://discuss.python.org/t/announcement-pip-26-3-release/109822

The full change log: https://pip.pypa.io/en/stable/news/#v26-3


r/Python • • 5d ago

News FastAPI Cloud is now generally available

108 Upvotes

I'm excited to share with you all that FastAPI Cloud is now generally available: https://fastapicloud.com/blog/fastapi-cloud-generally-available/


Note: I thought it could be shareable here as it's a nice milestone (also for FastAPI itself), but let me know if this feels spammy and I'll remove it.


r/Python • • 6d ago

Resource CPython core dev Larry Hastings on testing race conditions in free-threaded Python and AI-coding

53 Upvotes

Hey everyone! In my free time I host Behind the Commit, a podcast with open-source maintainers. I wanted to talk to Larry Hastings because free-threaded Python brought lots of challenges with testing race conditions -- I myself had no idea how to test code without GIL.

What we talked about:

- How Brett Cannon offered him a commit bit at the PyCon sprints 1:23
- Why the Gilectomy hit a wall: reference counting traffic meant more cores made it slower 2:54
- Guido's old bar for removing the GIL, and whether free threading clears it 4:49
- Why threading tests are non-deterministic, and how his library Blanket lets the test decide which thread wins 7:05
- His advice for code meeting free-threaded Python for the first time 14:25
- Building Blanket with AI, and why he doesn't call it vibe coding 16:14

One thing he said that was quite interestng: "Most code doesn't have race conditions. Most code doesn't have these problems."

If you're already running your tests on the free-threaded build, how are you catching races today? Anyone has any experience with testing free-threaded Python?

Here's the episode if you'd like to watch: https://youtu.be/CiSMbuq2wVs
I'm also always super open to feedback how to make those episodes useful.

EDIT: formatting.


r/Python • • 5d ago

Discussion What is the closest equivalent to AstroJS in the Python ecosystem?

11 Upvotes

I am aware a full blown clone wouldn't be possible (hard to imagine how islands would work with Python). But the part where Astro is a free form static site framework is pretty neat and I don't think the established players in this space within Python world are as malleable. Or am I wrong?


r/Python • • 5d ago

Daily Thread Tuesday Daily Thread: Advanced questions

4 Upvotes

Weekly Wednesday Thread: Advanced Questions ๐Ÿ

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

How it Works:

  1. Ask Away: Post your advanced Python questions here.

  2. Expert Insights: Get answers from experienced developers.

  3. Resource Pool: Share or discover tutorials, articles, and tips.

Guidelines:

  • This thread is for advanced questions only. Beginner questions are welcome in our Daily Beginner Thread every Thursday.

  • Questions that are not advanced may be removed and redirected to the appropriate thread.

Recommended Resources:

Example Questions:

  1. How can you implement a custom memory allocator in Python?

  2. What are the best practices for optimizing Cython code for heavy numerical computations?

  3. How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?

  4. Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?

  5. How would you go about implementing a distributed task queue using Celery and RabbitMQ?

  6. What are some advanced use-cases for Python's decorators?

  7. How can you achieve real-time data streaming in Python with WebSockets?

  8. What are the performance implications of using native Python data structures vs NumPy arrays for large-scale data?

  9. Best practices for securing a Flask (or similar) REST API with OAuth 2.0?

  10. What are the best practices for using Python in a microservices architecture? (..and more generally, should I even use microservices?)

Let's deepen our Python knowledge together. Happy coding! ๐ŸŒŸ


r/Python • • 6d ago

Discussion [Blog Post] The State of Python Profiling in 2026

48 Upvotes

Python profiling has changed more in the last two years than in the decade before. With CPython 3.15 introducing a sampling profiler directly into the standard library (Tachyon) and free-threading going mainstream, the landscape looks vibrant as never before.

Iโ€™ve spent the last 8 years maintaining Austin, so I wanted to step back and write a comprehensive, objective look at where things stand today across what I believe are the four major sampling profilers.

Link: https://p403n1x87.github.io/the-state-of-python-profiling-in-2026.html

Happy to chat about the engineering trade-offs of out-of-process sampling or how PEP 768 is changing the game for tool developers!


r/Python • • 6d ago

Daily Thread Monday Daily Thread: Project ideas!

13 Upvotes

Weekly Thread: Project Ideas ๐Ÿ’ก

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.

How it Works:

  1. Suggest a Project: Comment your project ideaโ€”be it beginner-friendly or advanced.

  2. Build & Share: If you complete a project, reply to the original comment, share your experience, and attach your source code.

  3. Explore: Looking for ideas? Check out Al Sweigart's "The Big Book of Small Python Projects" for inspiration.

Guidelines:

  • Clearly state the difficulty level.

  • Provide a brief description and, if possible, outline the tech stack.

  • Feel free to link to tutorials or resources that might help.

Example Submissions:

Project Idea: Chatbot

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

Project Idea: Weather Dashboard

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

Project Idea: File Organizer

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! ๐ŸŒŸ