Attach pdb to a Running Python Process. So No More Restarts! (Python 3.14)
You’ve probably been here before. A Python service has been running for hours and now it’s stuck, eating memory, or just doing something weird. You want to look inside it right now and see the local variables, the call stack, and where exactly the code is. Until recently your options were all bad: Add a breakpoint() and restart the process. But a restart throws away the exact state you wanted to inspect. Set up a third-party tool like pdb-attach ahead of time. That’s useless if you didn’t plan for this moment. Reach for gdb and poke at CPython internals. Powerful, but painful. Python 3.14 fixes this. You can now attach the built-in debugger to a live, unmodified process with one command. No restart, no pre-installed hooks, and zero runtime overhead when you’re not using it. This is the work of PEP 768 by Pablo Galindo Salgado, Matt Wozniski, and Ivona Stojanovic. ...
Prompts Change. Principles Don’t. Backend Engineering Fundamentals Matter More Than Ever
Introduction Backend engineering forms the structural core of modern web applications. While users interact with visually rich and dynamic front-end interfaces, it is the backend that executes the logic, safeguards data, and ensures the entire system behaves predictably. As AI-driven prompts and development workflows evolve rapidly, the foundational principles of backend engineering remain unchanged—and more crucial than ever. Core Components of Backend Systems Servers Servers execute application logic, manage client requests, and orchestrate interactions with databases and external services. They act as the primary environment where backend code runs, processing data and returning the appropriate responses with efficiency and consistency. ...
Using Formal Methods to Craft Powerful LLM Prompts
You’ve been there: When you ask an LLM to construct a function, it returns something that is nearly functional but ignores restrictions, fails on edge cases, or generates untestable spaghetti. What if I told you that LLMs could be trained to act like disciplined engineers? The secret tactic that most developers don’t employ is that: LLMs behave more consistently and produce better software when you organise your prompts using formal methods concepts. ...
Python requests vs httpx. A comparison and personal opinion.
When it comes to making HTTP requests, for developers the goto library is requests. But there is another library that has already a large fanbase and popularity is growing, it’s httpx. Both serve the purpose of sending HTTP requests, but they have subtle differences that can impact your choice depending on your specific needs. In this blog post, we will explore the features of Python’s requests and httpx library. How to install requests pip install requests httpx Using pip ...
Random or Secrets which module to use for critical information?
It’s easy to generate random numbers using the random module in Python. And we always do it when it’s required to send an OTP or a secret token to the user. The following code is the way we do it usually. import random random.randint(100000, 999999) This should generate a 6 digit random OTP code. But, according to the offical documentation of python secrets module, it’s not recommended to use the random module for generating passwords, account authentication, security tokens and related secrets. Instead secrets module is recommended. Which is designed for security or cryptography. ...