Python

Catch the import. Name the culprit. Keep threads free: Introducing gilguard On free-threaded Python, one import can quietly turn the GIL back on for good. gilguard turns that moment into an error that names the module, the package, and the line of your code that pulled it in.
Your GitHub language bar is lying (how to fix it) GitHub said my Rust project was 75% HTML. A few lines of .gitattributes told it to skip generated docs, vendored code, and tests, so the language bar now shows what the project really is.
Chameleon templates, modernized: chameleon-rs I rewrote Chameleon in Rust to make Python web apps faster. chameleon-rs runs your existing templates unchanged and adds async rendering, Markdown, and free-threaded Python support.
What the pls? The pls on PyPI is an abandoned Python version. The pls I recommend was rewritten in Rust, here's how to spot the difference and install the right one.
Cutting Python Web App Memory Over 31% I reduced Python web app memory by 3.2 GB using async workers, import isolation, the Raw+DC database pattern, and disk caching. Detailed before and after numbers for each technique.
Raw+DC Database Pattern: A Retrospective After migrating three production Python web apps to the Raw+DC database pattern, I share real-world performance benchmarks: nearly 2x requests per second, 18% less memory, native async support, and freedom from unmaintained ODM libraries.
Fire and Forget at Textual Will McGugan hit the same asyncio.create_task garbage collection bug at Textual - and found the pattern in over 500K GitHub files. Why didn't the Python team just fix the event loop?
Replacing Flask with Robyn wasn't worth it I converted Python Bytes from Quart/Flask to the Rust-backed Robyn framework and benchmarked it with Locust. The result: no meaningful speed or memory improvement. Here's why framework maturity still wins.
Use Chameleon templates in the Robyn web framework Introducing chameleon-robyn, a Python package that adds Chameleon template support to the Rust-backed Robyn web framework as an alternative to Jinja.
Fire and forget (or never) with Python’s asyncio Python's asyncio.create_task() can silently garbage collect fire-and-forget tasks in 3.12+. Learn the background_tasks set pattern to fix it.
Raw+DC: The ORM pattern of 2026? After 25+ years championing ORMs, I've switched to raw database queries paired with Python dataclasses. Better AI coding support, fewer aging dependencies, surprising performance gains, and type safety where it counts.
Always activate the venv (a shell script) Stop forgetting to activate your Python virtualenv. This post shares a small Zsh script that automatically finds and activates venv or .venv as you move through project folders, plus a quick security warning and install steps.
Python Numbers Every Programmer Should Know A cheat sheet of real-world timing and memory numbers to guide performance-sensitive decisions.
DevOps Python Supply Chain Security Stop malicious Python packages before they reach your development environment.
Python Supply Chain Security Made Easy Wire pip-audit into your CI and unit tests to automatically block known vulnerable dependencies.
Course: Agentic AI for Python Devs I just published my first course on using agentic AI for writing Python code.
Talk Python in Production book is out! A cloud-agnostic guide to building, scaling, and managing your own python infrastructure.
Michael's Top Trends of 2024 for Python Web Devs What are my top 8 trends of 2024 for Python web developers?
Talk Python migrated to Quart web framework And I did a big write up in case it helps anyone on similar journeys.
Introducing chameleon-flask package A new package to add Chameleon HTML support to Flask.
We Must Replace uWSGI With Something Else uWSGI is in minimal maintenance mode, now what?
Let's go easy on PyPI, OK? Why do we pound PyPI when we have caching?
Docker images using uv's python uv has added a new way to build Python-based containers.
Keynote: The State of Python in 2024 Michael Kennedy's keynote at PyCon Philippines 2024.
Sometimes, You Should Build It Yourself When it's healthy to embrace your 'not built here' tendencies.
Properly Factor Your Jinja HTML Code with Jinja Partials You wouldn't write 500 lines of Python in one function, so why do it in HTML?
Black Friday: A Lesson in Python Performance Black Friday almost melted our servers
Python 3.11 in 100 Seconds Learn about Python 3.11 in 100 seconds with my latest video.
20% Faster Python with a Single GC Tweak Your Python GC settings are wrong and they are hurting your performance.
Python's Entire Codebase Leaked A 'cyber-security' incident may have surfaced.
Take these Pythonic tips with you You might have heard about my Write Pythonic Code Like a Seasoned Developer course. In that course, I cover 52+ idiomatic ideas from Python. Just to give you an idea, it talks about using for-in loops...
Know .NET? Learn Python with our free webcast in February! Are you a .NET developer and are considering Python as your next language to expand your knowledge and skill set? Come spend an hour with me during my next free webcast. ! There are many getting start...
Top 5 Talk Python Episodes of 2019 It’s been a great year over at Talk Python. The podcast has been going strong with many listeners from every corner of the global. We’ve launched a bunch of new courses at Talk Python Training and eve...
Is Python right for your team? Over at Talk Python, we’re doing a fun online event for people exploring Python and whether it’s a fit for their organization or for their team. Is Python right for your organization? Are you tasked w...
A couple of podcast interviews (me as a guest) Hi everyone. I recently got the chance to be interviewed on two podcast / youtube shows. They were a ton of fun and I think we actually covered a ton of fun topics that were both technically deep as w...
Learn Python Web Development with our latest course Hey everyone, I’m super excited to share a project I’ve been working on over the past couple of months. We just released a new course over at Talk Python Training. !python-data-web-appspython-data-web...
Eve: Building RESTful APIs with MongoDB and Flask Want to build MongoDB-backed RESTful web services in Python? Over at Talk Python Training , we just launched a new course on the Eve RESTful framework. It’s called Eve: Building RESTful APIs with Mong...
Why is Python hard on Windows? You tell me! I’m building some resources to make using, developing on, and teaching with Python on Windows easier and better. If you’ve used Python on Windows, please tell me about your experiences so we can pay i...
MongoDB Quickstart with Python: A new, free course to teach you MongoDB Have you been wanting to learn MongoDB or how to work with it from Python? If you’ve been on the fence about taking an online course or have been unhappy with ones you’ve taken before, here’s a great ...
Yelp Reviews: Authorship Attribution with Python and scikit-learn This is a guest post by Gareth Dwyer is an author for DevelopIntelligence, who offers Python Training for Teams. Yelp Reviews: Authorship Attribution with Python and scikit-learn When people write tex...
New course: Consuming HTTP services in Python I’m thrilled to announce a new Talk Python course: Consuming HTTP, RESTful, and SOAP Services in Python Visit the course page to join What’s this course about? This course will show you how easy it is...
Write Pythonic Code for Better Data Science (recording available) I recently did a live webcast in conjunction with dataschool.io called Write Pythonic Code for Better Data Science. You might be thinking, “Live webcast, well that’s a little late, isn’t it?” Well, no...
Announcing Python Bytes Podcast: Python headlines delivered to your earbuds I’m very excited to let you know that I have joined forces with Brian Okken to launch a second podcast called Python Bytes. The idea is we’ll deliver Python headlines directly to your earbuds over the...
Pre-order Python for Entrepreneurs course Good news! My popular course Python for Entrepreneurs is now available for pre-order with immediate access to the first 4 hours of content and more coming every week! You’ll even save $30 off the fina...
Pythonic code by example in 5 videos (video series) I recently partnered with the folks over at Data Dependence to put together a video series called: Video Series Taking Your Python Skills to the Next Level With Pythonic Code Check out the original po...
Python for Entrepreneurs Kickstarter Launches Today I’m thrilled to announce that today, in partnership with Matt Makai of Full Stack Python , I have launched a kickstarter to fund the creation of my most anticipated course: Python for Entrepreneurs !p...
New course: Write Pythonic Code Like a Seasoned Developer I’m thrilled to announce the second online Python course in my grand plan to create an amazing online resource for Python developers. Write Pythonic Code Like a Seasoned Developer You can buy the cour...
Python for the C# developer (live from NDC Oslo 2016) Are you spending your days writing .NET and C code? What is it you love about C and the .NET ecosystem? Do you love Entity Framework and the hyper productivity of a great ORM? How about ASP.NET MVC as...
Away from the keyboard podcast: Michael Kennedy Goes Around The World With Python Hi all, I had the honor to spend an hour with Cecil Phillip and Richie Rump on their laid back technical, but casual podcast Away From The Keyboard. I really enjoyed the conversation and I think you w...
Talk Python Courses: You’ve asked, I’ve listened (and coded) Hi everyone. My Python Jumpstart by Building 10 Apps course has been out for awhile now. I’ve already started on the next one which I’m calling Python for Entrepreneurs. I’ll keep you posted as that d...
The Final 36 Hours: Python Jumpstart Video Course Kickstarter Update : Check out my Python for Entrepreneurs course running on Kickstarter now There are just 36 hours left in my online Python course Kickstarter. Python Jumpstart by Building 10 Apps !kick-status-...
9 reasons you should be using PyCharm On my podcast, Talk Python To Me, I’m working on an episode highlighting PyCharm, the amazing IDE from JetBrains. Here’s a blog post to accompany that episode. Update: Listen to the podcast interview ...
Land your first Python software development job on Talk Python I’m looking for a handful of people to put together a unique episode of my podcast Talk Python To Me. Can you help? There are two groups of people who I’m looking to spend 10 minutes talking with: 1. ...
Come Learn Python and Be Part of Talk Python To Me! Are you interested in learning Python? Well, my buddies from San Diego: Scott Reed, Brad Cunningham, and Ike Ellis from Crafting Bytes just started the Python edition of their Technology Immersion Gro...
A look inside Netflix’s cloud systems: Python at Netflix This week I released an excellent interview with Roy Rapoport from Netflix about the amazing ways Python is being used at Netflix. Listen in: Talk Python To Me – Episode 16 Python at Netflix < In case...
I made an appearance on the Geek Cookies podcast I had the honor of being a guest on the Italian Podcast Geek Cookies last week and the guys were even willing to switch to English for the main interview. If you want to here an interesting, high-leve...
Python Podcast Episode #3 – Pyramid Web Framework Just a quick note that there is another episode of Talk Python To Me. This time I’m speaking with Chris McDonough about the Pyramid Web Framework. Listen in now, hope you enjoy the show! !e3
New Podcast Episode: Python and MongoDB I recorded a session with Jesse Davis from MongoDB on Talk Python To Me. I think the show came out great. You should check it out! !Episode 2: Python and MongoDB with Jesse Davis this show we speak wi...
Announcing new podcast: Talk Python To Me I’m super excited to announce that I just launched a brand new podcast for Python developers calledTalk Python To Me. This weekly podcast already has the first episode published and some amazing guest...
10 Myths of Enterprise Python from PayPal Update : Listen to my interview with Mahmoud Hashemi from PayPal on this topic on the Talk Python To Me Podcast, Episode 4 Yesterday I stumbled across an excellent article by Mahmoud Hashemi from the ...
Python for the .NET Developer on .NET Rocks Note : This news is old, I somehow missed posting it to my blog. So here it is! ! Show 951: Python on .NET with Michael Kennedy Back in February, I had the honor of being the guest on the .NET Rocks ...
Better Python Integration in Windows: Shebangs and Version Selectors I’ve written several times on efforts to make Python better on Windows. I also have an outstanding request to the Windows 10 team to get Python built directly into Windows 10 please upvote it!. In thi...
Comparison of Python and Apple’s Swift Programming Language Syntax !python vs. swiftAs a Python and C developer, I have been intrigued ever since Apple announced the Swift programming language to cheering crowds at WWDC 2014. This post will explore the syntax of Pyth...
Shipping Python with Windows 10 Python is awesome but Python on Windows always feels like the red-headed step child. With Windows 10’s UserVoice campaign, you can help me change that! Let’s start here: Please vote for this request on...