r/Python • • 4h ago

News Python 3.15.2, 3.14.10, 3.13.18, 3.12.16 and 3.11.18 are out

81 Upvotes

r/Python • • 15h ago

News Microsoft partners w/ Meta to bring Pyrefly support to Pylance in VS Code

82 Upvotes

Link to blog: https://devblogs.microsoft.com/python/announcing-tsp/

TLDR:

Pylance (Microsoft's Python extension for VS Code) now officially supports using Meta's Pyrefly to power its analysis.

To enable this, Microsoft developed an extension to the language server protocol (LSP) called the type server protocol (TSP), a new standard that separates wider set of language server features from the type checker/compiler powering some of them.


r/Python • • 4h ago

Daily Thread Tuesday Daily Thread: Advanced questions

1 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 • • 1d ago

Daily Thread Monday Daily Thread: Project ideas!

8 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! 🌟


r/Python • • 11h ago

Discussion does using AI to learn code really work?

0 Upvotes

hello!

I am a data science student, have been coding 2 years.

I recently use AI to code python, or checking codes people already made or teacher gives us assingment.

but is it really helpful to learn how to code do you think?

i check every single code if i got assingment by asking AI to explain that.

it doesnt feel i study something so i worry about that i really study.

can you guys give me some tips ?


r/Python • • 12h ago

Discussion Why does python has a middle layer of creating bytecode?

0 Upvotes
  1. Is bytecode platform-specific, and why?
  2. What does bytecode look like?
  3. What is the difference between a C++ executable file produced after compilation and what a Python VM produces?
  4. What does the Python VM actually produce? Is it a binary, CPU instructions, or something else?
  5. What is the difference between a binary, an executable, and a CPU instruction? Explain from the basics in detail with specific examples.

r/Python • • 2d ago

News LiteLLM’s root-cause report: the key behind the Oct 21 release attack was leaked on May 27 and never

137 Upvotes

https://youtu.be/vxE3XbcLCa8

LiteLLM published its root-cause report on Oct 23. According to LiteLLM, a master key for its Agent Platform was committed publicly on May 27. The team found the leak and rewrote the commit, but the key wasn’t revoked.

LiteLLM says the attacker used that key on Oct 10 to get a GitHub org owner’s token, then took two maintainers’ tokens. Branch protections were disabled. The release was built from a lookalike repo, Berri-AI instead of BerriAI. Malicious 1.107.0 went out on PyPI and container images on Oct 21.

Separately, JFrog, Microsoft and Socket confirm the malware and some earlier malicious workflows. The full chain from the leaked key to the release rests on LiteLLM’s own account.


r/Python • • 2d ago

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

13 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 • • 2d ago

News [CVE-2026-111497] If you run a python server, you should update it right now

227 Upvotes

The "HTTP2Shell" vulnerability affects servers that know how to speak Google's 'brotli' compression protocol, which would likely make its way into your server through an innoccuous-sounding speedup dep like urllib3[brotli] or aiohttp[speedups], and could be used by basically any server, including Flask, Quart, Starlette, FastAPI, etc. It was downloaded 4,200,000 times from PyPI yesterday alone, to give you a sense of the scale.

To find out if you're affected, run a command like on of these...

pip list    | grep -i brotli

uv tree     | grep -i brotli

poetry show | grep -i brotli

...etc., looking for brotli <= 1.2.0 and/or brotlicffi <= 1.2.0.2. If you're affected, obviously update & redeploy immediately.

Beyond that... well, the (colloquial) name kinda says it all. Given the new Cyber normal, I would assume that you have malicious software running on that system and any connected to it until proven otherwise. Check for bitcoin miners, worms, sentient bot swarms -- the usual.

(Note for beginners: this doesn't apply to stuff you run locally, but rather to servers that have been exposed to the public internet. Still worth checking!)

I wasn't gonna post this b/c I'm so not an expert, but it hasn't hit this sub yet and feels particularly bad... not many solo/SMB devs are self-hosting PHP servers, but anyone who's searched "python server compression algo speedup packages" and picked one of the top choices (or let their agent do so) is at huge risk here. I only know about it because of doomscrolling HackerNews, which feels unreliable!

Does anyone kn*w a good way to to get notified proactively for Python-relevant CVEs and other incidents?


r/Python • • 3d 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 • • 3d ago

News LiteLLM 1.107.0 on PyPI was malicious (Oct 21): it runs on every Python start via a .pth file.

25 Upvotes

I wrote this up. How to check safely and what to rotate
Short version: if you installed an unpinned litellm between 11:39 and 13:23 UTC on October 21, or pulled the latest, main-latest, main-stable or v1.107.0 Docker tags between 11:46 and 14:20 UTC, treat the machine as compromised. Don't start with pip, because the cook.pth and sitecustomize.py files run on every interpreter start. Search the filesystem first, rebuild with litellm==1.106.2, and rotate keys. All of it comes from LiteLLM's own incident report.


r/Python • • 4d ago

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

14 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

Discussion Heads up time for package devs

0 Upvotes

Don't you think companies or developers that manage python libraries should be given extra time before a new version release to make things compatible and fix new bugs?

Like a month or two where they get full info about new features but before the version is publicly available to download?

It would make things easier on the consumer end. What do you think?


r/Python • • 5d ago

News litellm 1.107.0 on PyPI is compromised

402 Upvotes

the payloads run on every python start on the machine and not just when you import litellm. Your IDE, pip, CI jobs everything python on that host is affected.

It steals ssh keys, aws credentials, browser passwords, shell history and AI coding tool configs. The backdoor runs as a daemon and executes whatever code the attacker’s server returns every hour.

Pin to 1.106.2.

complete breakdown: safedep.io/litellm-pypi-compromise-credential-stealer-backdoor


r/Python • • 5d ago

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

8 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 • • 5d ago

Discussion How much time to wait before adopting a new Python version ?

49 Upvotes

I tried to start using 3.15, but a lot of libraries don't have packages that support it yet.

In your own experience, what's a good amount of time to wait where most of the libraries support the new version? 1 month, 3 months, 6 months?


r/Python • • 4d ago

Discussion Timed every test in my pytest suite: 3% of the tests ate 77% of the time

0 Upvotes

Some context first: I'm one person building an open-source research tool, and most of the code is written by AI coding agents (Claude Code and Codex) running in parallel. They write code quickly. What slowed everything down was the test suite: on one recent change the merge check selected 406 test files and took just over four hours, and the agents sat idle the whole time.

So I pulled together every timing the suite had already recorded (old JUnit XML and --durations output) and summed it per test. That covers about 9,000 test IDs seen across past runs, around 6,800 of which still exist.

243 of them, under 3%, took 77% of the summed time. Most of those build a whole workspace and run an end-to-end day of the app. Also, not a single test qualified as "small" in the Google sense (no disk, no network), because one autouse fixture asks for tmp_path on every test.

So I'm moving to Google's small/medium/large split (the 2010 Testing Blog post). Merge checks will run small and medium only, and the large ones go to release candidates and a nightly run. After that I want per-size timeouts with pytest-timeout, so a "medium" test that slowly grows into a large one fails instead of quietly eating everyone's time.

Two mistakes I made along the way:

The first labelling pass went by names. Anything with "golden" or "first_use" in it got marked large. When someone actually read the bodies, 28 of the 54 groups were fast in-memory checks. They'd have dropped out of merge runs entirely. Label by fixtures and what the test does, not the name.

The other one was worse. I select tests for a merge by following imports from the changed files. My script followed imports through the package but never through shared test helpers or conftest. For one change to a common helper it selected 6 test files; a selector that follows those edges selected 405. I'd been running a fast gate that was mostly blind to helper changes.

Next I'm trying pytest-testmon for coverage-based selection, running it next to the import-based one on real diffs before I trust it on its own.

Curious how others handle this. Do you split by size, or just throw more CI machines at it?


r/Python • • 6d ago

Discussion Anaconda - what is the word on the street, would you work there?

59 Upvotes

Is this company (Anaconda) doing well, would you work there?

Have you heard anything positive or negative about working there?

Thanks.


r/Python • • 6d ago

News Info for Python users regarding eMudhra / emSign CA certificate security incident

160 Upvotes

A security incident affecting eMudhra intermediate certificates has required removing the emSign root CA certificate from CA bundles such as “certifi”. It’s important to immediately upgrade the software packages below to at least the versions specified and rebuild container images to fetch the latest system certificates. Failure to do so could result in monster-in-the-middle (MITM) attacks against TLS clients, including python.org and pypi.org .

(1): Advisory mentions 2026.10.18, but 2026.10.19 is recommended for compatibility with unaffected emSign root certificates.

For all existing virtual environments on your system, please upgrade pip and uv to the latest versions.

Please read the full post on discuss.python.org for up-to-date information: https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576


r/Python • • 6d ago

News Request for feedback: uv check & PEP 723 script support in ty

112 Upvotes

We've been working on PEP 723 inline metadata support for ty both on the command line (ty check) and in the IDE (code navigation, autocompletion, etc) for a while now; we're finally at a stage where we're ready for more people to try it out and let us know what works and what doesn't.

This required integrating ty with uv, which also let us ship a new uv check command that uses ty to check your entire project or workspace (similar to how uv format uses Ruff). All of the above is powered by a brand new uv workspace metadata command that carries the required information between the tools.

More details in the blog post, including how to try these.

All of the above is currently opt-in, experimental, and subject to change at any time 😄 But if you're willing to give it a try, I'd be curious how it went.


r/Python • • 6d ago

Resource Python Hash Verification

10 Upvotes

My boss is thinking about using python in a secure VPN environment. Because of this, we have to validate the hash of the python download and any libraries used.

I looked on the site but didn't see anything. Is there somewhere we can find the hash value so we can validate the download vs the hash code?


r/Python • • 6d ago

Resource Summary of Major Changes Between Python Versions (2026 Update)

101 Upvotes

Hi r/python 👋

Another year, another version of Python, and yet more features to guess which version of Python they belong to 😵‍💫

I've updated my "one page" Summary of Major Changes Between Python Versions for Python 3.15 and hope that it continues to be a useful resource for the community 😊

This summary is human typed/copied from the official release notes.


r/Python • • 5d ago

Discussion I have found PyCharm lacking

0 Upvotes

Correct me if I am wrong but a normal thing to do is import a module and possibly create new attributes on an object instantiated from such. For some reason PyCharm recognizes this as a warning. I normally like the JetBrains IDEs because when you get rid of all the static analysis warnings you know you are kosher, to some degree. I can't get rid of this warning. Load up the same code in VS Code and it's no problem.


r/Python • • 7d ago

Discussion OSS Projects with Strict Maintainers?

49 Upvotes

Hi,

A senior dev left left my team and with them left a lot of the code standards. Previously code review was painful and took hours and sometimes it would require a rewrite. However, that was the best code I have probably ever written. I genuinely enjoyed learning coding principles from someone who had been doing it for 20+ years and had reasons behind their principles. Its hard to find discipline these days.

Are there any projects that come to mind that have abrasive or strict longstanding maintainers? My preferred languages are Python and Go but I'd be willing to learn something new.


r/Python • • 7d ago

News Announcing Python Software Foundation Fellow Members for Q3 2026!

34 Upvotes

https://pyfound.blogspot.com/2026/10/announcing-python-software-foundation.html

The PSF is pleased to announce its third batch of PSF Fellows for 2026. Let us welcome the new PSF Fellows for Q3! The following people continue to do amazing things for the Python community:

  • Aldo Caneo
  • Donghee Na
  • Paul Moore
  • Takayuki Shimizukawa

Thank you for your continued contributions. We have added you to our Fellows Roster.