r/Python • • 16h ago

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

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

Advent of Code 2026

24 Upvotes

Join the Advent of Code Challenge with Python!

Hey Pythonistas! 🐍

It's that exciting time of the year again! The Advent of Code has just started, and we're inviting everyone to join in the fun!

What is Advent of Code?

Advent of Code is an annual online event that runs from December 1st to December 12th (or til the 25th for older years). Each day, a new coding challenge is releasedβ€”two puzzles that are part of a continuing story. It's a fantastic way to improve your coding skills and get into the holiday spirit!

You can read more about it here.

Why Python?

Python is a great choice for these challenges due to its readability and wide range of libraries. Whether you're a beginner or an experienced coder, Python makes solving these puzzles both fun and educational.

How to Participate?

  1. Sign Up/In.
  2. Join the r/Python private leaderboard with code 2186960-67024e32
  3. Start solving the puzzles released each day using Python.
  4. Share your solutions and discuss strategies with the community.

Join the r/Python Leaderboard!

We can have up to 200 people in a private leaderboard, so this may go over poorly - but you can join us with the following code: 2186960-67024e32

How to Share Your Solutions?

You can join the Python Discord to discuss the challenges, share your solutions, or you can post in the r/AdventOfCode mega-thread for solutions.

There will be a stickied post for each day's challenge. Please follow their subreddit-specific rules. Also, shroud your solutions in spoiler tags like this

Resources

Community

AoC

Python Discord

The Python Discord will also be participating in this year's Advent of Code. Join it to discuss the challenges, share your solutions, and meet other Pythonistas. You will also find they've set up a Discord bot for joining in the fun by linking your AoC account.Check out their Advent of Code FAQ channel.

Let's code, share, and celebrate this festive season with Python and the global coding community! 🌟

Happy coding! πŸŽ„

P.S. - Any issues in this thread? Send us a modmail.


r/Python • • 9h ago

Discussion I compared the libraries Python projects used from 2018 to 2026

32 Upvotes

PyPI's BigQuery table lists the dependencies of every uploaded file. I counted how many projects require each library in every year from 2018 to 2026, then split the 2026 projects into new ones (first upload in 2026) and older ones.

New projects pick the newer library

  • Typer 15,442 vs Click 13,057
  • httpx 34,876 vs requests 21,190
  • FastAPI 10,852 vs Django 2,221

Older projects keep what they had

  • Click 6,209 vs Typer 3,078
  • requests 16,210 vs httpx 5,673
  • FastAPI 2,416 vs Django 2,293 (close)

Almost nobody switches. Of the projects that required the old library in 2024 and released again in 2026:

  • Click β†’ Typer: 32 of 2,654 (1.2%)
  • requests β†’ httpx: 161 of 7,765 (2.1%)
  • pandas β†’ Polars: 23 of 6,182 (0.4%)
  • Django β†’ FastAPI: 0 of 1,214

Some old libraries keep their lead anyway

  • pandas 28,787 vs Polars 3,012
  • Matplotlib 18,488 vs Plotly 2,974
  • PyTorch 10,298 vs TensorFlow 713 (TensorFlow fell from 1.6% of projects in 2020 to 0.3%)

"Isn't this just LLM projects?" Partly. 17% of the new projects with dependencies require an LLM SDK, and about a third of new httpx and FastAPI projects do. But two thirds of them require none.

Limits: these are declared dependencies, not imports. Optional extras are left out. Every project counts once, popular or not. 2026 runs to 2 December.

Charts per pair, the BigQuery query to check your own libraries, and the full switching table: https://py-code.org/blog/python-library-adoption-pypi/

  • If you maintain a project on requests, Click or pandas, what would it take for you to switch? Or is "it works" reason enough to stay?
  • If you did migrate an existing project (requests β†’ httpx, pandas β†’ Polars, Flask β†’ FastAPI), was it worth the effort?
  • For new projects, what made you pick httpx or Typer over the old default?

r/Python • • 12h ago

Discussion promoting the Python programming language through practical examples?

0 Upvotes

What do you think of my efforts to promote the Python language?

Most recently, I’ve been working on an ARM-based system using the Pydroid3 IDE.

Do you know of any other Python-related promotional initiatives for the Python community?


r/Python • • 12h ago

News Benchmarking python-json-logger: logging exceptions is slowwwww (and v4.3.0rc1 release)

5 Upvotes

Hi r/python πŸ‘‹ - maintainer of python-json-logger here.

In 2024, shortly after taking over maintenance of python-json-logger, I introduced support for using the high performance JSON encoders: Orjson and MsgSpec (v3.1.0 - ignore the wrong date will be updated on the next final release). Although there are many benchmarks available for these encoders, it wasn't until recently that I got the time (and tokens) to introduce some proper benchmarking. The full report is available here and includes pretty graphs.

The TLDR is that depending on workload you can expect a 2-5x speedup by using the high performance JSON encoders with CPython. This still significantly beats PyPy which at best expects a 2x speedup (note: neither Orjson or MsgSpec support PyPy).

The most surpsing result was for the formatting of exc_info. Although serialisation could enjoy an aproximate 7-8x speedup, serialisation is actually only a small part of the total time spent formatting log records with exc_info.

Using the results of Python 3.15 as an example: it turns out generating the exception info is really expensive - like ~20x more expensive than a simple log record. The total time spent formatting a simple record is ~2.2 microseconds comapred with a record with a exc_info which is ~44 microseconds and of which only ~1.6 microseconds is spent in serialisation.

So Amdahl's Law kicks in and we get almost no overall speedup. I'm also pretty sure this is the first time I've thought about Amdahls Law since university πŸ€”.

The exc_info case is also the only time that PyPy actually beats the high performance JSON encoders, not because it's encoding faster but (presumably) because it can produce the information faster.

As I'm writing this it also looks like the creation of exc_info has also aproximately doubled b CPython 3.10 (presumably due to all the extra info that is now included in tracebacks, but I've done no analysis on that, nor do I intend to).

-------------------

I've also just uploaded v4.3.0rc1 (change log) which includes a 5-10% performance improvement amongst many other changes and fixes.

This will also be the first release to use Trusted Publishing πŸŽ‰


r/Python • • 23h ago

Discussion Polars for data-heavy datasets

82 Upvotes

A few months back I switched from pandas to polars because some of the datasets I needed to work with were hitting the million row mark and beyond. It has taken quite some time to get used to the more verbose polars dataframe methods but I have to say I am really pleased with the execution speed improvement.

I also moved away from applying filters and calculating, migrating to the group_by.agg() for performing row calculations - HUGE difference in speed.

For those of you who haven't heard of polars, it is multi-threaded whereas pandas is single-threaded, so for large datasets it is faster. I would never have made the switch were it not for large datasets, and I frequently convert to pandas dataframes when debugging.

Anyone else have similar experiences or have resisted the urge to migrate away from pandas?


r/Python • • 1d ago

News ty 1.0 is now out: Astral's Rust-based type checker and language server is now stable

522 Upvotes

https://astral.sh/blog/ty-1.0

Astral just announced ty 1.0. It's a type checker and language server meant as an alternative to mypy/Pyright/Pyrefly.

The benchmarks look really good and it has support for Pydantic, Django, pytest, and attrs and seems to have less false positives/negatives vs mypy.

Has anyone tried it on a real codebase? Will this be the new default type-checker that everybody will use?


r/Python • • 2d ago

Daily Thread Tuesday Daily Thread: Advanced questions

10 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 • • 3d ago

Daily Thread Monday Daily Thread: Project ideas!

6 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 • • 4d ago

News PEP 824: None-coalescing operators is approved

347 Upvotes

The Steering Council has decided to accept PEP 824 (on the condition that the ??= operator is removed, leaving only the ?? operator in the proposal).

Old: lst = [] if lst is None else lst
New: lst = lst ?? []

Discussion thread: https://discuss.python.org/t/pep-824-none-coalescing-operators/109161/93

The decision on PEP 823 – None-aware access operators is still pending.


r/Python • • 4d ago

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

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

Discussion PEP 671 – Syntax for late-bound function argument defaults

76 Upvotes

https://peps.python.org/pep-0671/

The PEP was originally proposed in October 2021 but didnt get much traction. Through some discussions on the python discuss the author picked it up again and reproposed it for 3.17

It proposes a new syntax argument => late_bound_default()

def add_item(item, target=>[]):
def bisect_right(a, x, lo=0, hi=>len(a), *, key=None):

for late binding of argument defaults. This would allow avoiding the common mutable default argument trap and would allow for defaults to refer to previous arguments as seen in the biset_right example above.

Discussion can be found here: https://discuss.python.org/t/pep-671-syntax-for-late-bound-function-argument-defaults/110297

Note: I am not the PEP author


r/Python • • 6d ago

Resource Fourth collection of Python Problems for CCPS 109

13 Upvotes

Earlier this year, I completed the collection of 3 * 123 = 369 coding problems in Python used in the TMU Chang School courses CCPS 109 and beyond. After that I decided to move on to creating other things.

109 Python Problems for CCPS 109

However, with recent advances in AI and LLM's, I wanted to test the current capability of Claude Opus by asking it to first read through the earlier problem collection, and then create new problems trying to imitate my style in writing, problem creation and coding. With some feedback back and forth, I think it did better job being me than I did myself.

The resulting collection of 109 new coding problems, the specs and unit mass testers for each function, is now posted on the project GitHub repo, as Fourth Problem Collection. Hopefully Python students of all levels will find something interesting in this collection.


r/Python • • 6d ago

Discussion What Python libraries do you think every backend developer should learn beyond FastAPI and Pandas?

79 Upvotes

I'm curious about what Python libraries experienced developers consider essential for backend development.
I'm currently exploring FastAPI and learning more about the Python ecosystem. Beyond the usual frameworks, what libraries do you find yourself using regularly in real-world projects?
I'd love to discover some underrated libraries that are genuinely useful in production projects, not just popular ones.
What are your must-have Python libraries, and why?


r/Python • • 6d ago

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

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

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

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

Resource Tell me what python code to mess a round

0 Upvotes

Type a random python code in the comments to mess around for a flight that’s coming up soon and I really wanna mess a round with some python cod


r/Python • • 7d ago

Discussion what's your setup for config across dev and prod in a small python project?

27 Upvotes

i keep going back and forth between a .env file loaded with python-dotenv, a pydantic settings class, and plain os.environ lookups. for a small project with one dev and one prod environment, what has actually held up for you? mostly curious how you deal with secrets and defaults without it turning into a mess after a year.


r/Python • • 7d ago

Discussion zip(strict=True) catches mismatched lengths, but potentially much later than you'd want

75 Upvotes

I've been adding strict=True to quite a few zip() calls in our codebase and ran into a subtle distinction that's worth keeping in mind.

Consider something like:

for user, email in zip(users, emails, strict=True):

    send_email(user, email)

If the iterables have different lengths, Python will raise a ValueError. But by that point you might have already sent hundreds of emails.

Obviously this is consistent with how lazy iteration works. Still, I think the name "strict" can give a slightly misleading sense of safety when you're reading code that performs side effects.

For small inputs, materializing the zipped pairs before processing them solves this particular issue. For large streams, things get more interesting.

I've started distinguishing between validation that happens before processing and validation that happens during processing when reviewing iterator-heavy Python code.

Are there other standard library features where this distinction has caught you out?


r/Python • • 8d ago

Discussion I've started treating the output of my little Python scripts as a user interface

155 Upvotes

I inherited a bunch of internal Python scripts at work last year. Most of them were perfectly readable, did their job and had been running for years without any major issues.

The annoying part was figuring out what they'd actually done.

One would print "Done" whether it processed 400 files or found nothing to process. Another would silently skip invalid records. To understand the result of a successful run I sometimes had to read the source code.

I've since developed a habit of ending even fairly trivial scripts with a small summary of what was found, what changed, what was skipped and why.

It's probably the smallest change I've made to my coding habits with the biggest practical payoff. Especially when revisiting something I wrote six months ago.

I think we spend a disproportionate amount of time making Python code pleasant for other developers to read compared to making Python programs pleasant for other people to actually run.


r/Python • • 9d ago

News I built a local YouTube-to-Shorts clipper in Python 3.11+ using FFmpeg and deterministic DSP heurist

4 Upvotes

Hey r/Python! I wanted a way to automatically turn long YouTube videos into vertical 9:16 clips without paying for LLM APIs or running heavy PyTorch models on an old laptop.

How Max Clipper works under the hood:

- Explainable Clip Picking: Uses deterministic DSP and statistical heuristics (hook, audio energy, pacing, heatmap) instead of black-box LLMsβ€”same input always gives the exact same output.

- Low-Spec Optimization: Built and tested on a 4th-gen Intel i5 with 8GB RAM and no GPU. Uses a global render lock to prevent FFmpeg CPU starvation, stall-based timeouts, and -preset ultrafast on <= 4 cores.

- Packaging: One-command installers for Linux/macOS/Windows plus Docker support.

Source Code (MIT License): https://github.com/4hmed1/MaxClipper

Would love code review or feedback on the clip-scoring heuristics!


r/Python • • 9d ago

News Train in Your Tab: PyTorch, JAX and ML Compilers in the Browser

18 Upvotes

Hi,
I'm sharing a blogpost about how we are now able to use PyTorch or Jax in your notebook in the browser ! : https://notebook.link/blog/train-in-your-tab/
Here some examples (be sure to use a WebGPU compatible browser):


r/Python • • 9d ago

Discussion PyInstaller on Windows: does code signing stop Smart App Control blocking the DLLs?

44 Upvotes

I ship a desktop app with a python backend frozen with pyinstaller, currently unsigned. Two problems on Windows:

  • SmartScreen "Windows protected your PC" on every fresh download
  • worse: on some users' machines Smart App Control blocks the bundled .pyd/.dll files ("An Application Control policy has blocked this file") and the app just dies on startup

I'm about to pay for signing, and the part I can't find a straight answer on is the pyinstaller side:

  1. Is signing the main exe enough, or do you have to sign every .pyd and .dll inside the bundle (incl. python3xx.dll and third party wheels) before freezing?
  2. Has anyone seen Smart App Control actually stop blocking after signing, or does it still flag new files until reputation builds?
  3. onefile vs onedir, does it matter here? onefile extracts to temp, which feels like exactly what SAC hates.

If you've been through this, what did your build pipeline end up looking like?