
Helping Python developers build with AI: apps, agents, models, and AI-assisted coding. Expert-reviewed tutorials and courses, read by 1M+ developers a month.
Joined August 2012
- Tweets86.5K
- Following168
- Followers267K
- Likes57.1K
Pinned Tweet
Lost for a second in a Real Python video course?
Ask Mentor AI, the AI study companion, what the instructor just said. Follow up on side questions. Quiz yourself before the next lesson.
realpython.com/mentor/?utm_s…
Codex CLI wired up the Delete and Clear All buttons in a Python contact book app, and both worked.
Two of the five methods it added only called another method.
This thread covers the /diff review that caught them and four more habits for keeping Codex CLI in check 🧵
1
1
446
The first time you run codex in a folder, it asks whether you trust the folder's contents.
It asks because of prompt injection. Files someone else controls, like a repo you just cloned, can carry instructions that steer the agent.
1
105
What did you last clean up after an AI coding agent's change that already worked?
The tutorial also has Codex CLI's full plan and a diff that adds delete confirmation.
realpython.com/codex-cli/?ut…
112
Your LLM can't read all your company docs at once. Something has to pick the right ones first.
That's what a vector database does. ChromaDB lets you store text as numbers and pull back the closest matches in Python.
realpython.com/chromadb-vect…
In this tutorial's test, setting Meta's Muse Spark to "minimal" reasoning cut latency by more than half and cost by about 60%, with no loss in accuracy.
Its API speaks the same protocol as OpenAI's, so a few lines of Python get you started.
realpython.com/meta-muse-pyt…
5
1,088
Python 3.15 makes UTF-8 the default encoding. Your code must run on older versions too, Windows included.
5 checks for portable file I/O:
1. Mojibake with no error
2. Defaults beyond open()
3. A flag to find bare calls
4. A locale call that changed
5. A library author's fix 🧵
5. Writing a library function with an encoding=None parameter? Pass it through io.text_encoding() before you call open().
Then, when a user turns on EncodingWarning, it points at their call to your function, so they see which of their lines to fix.
Has a bare open() ever bitten you on Windows? What did your text turn into?
The tutorial also covers two ways to bring the old locale behavior back.
realpython.com/python315-utf…
1
325
The agent's code runs. What evidence says you should keep it?
The RECAP method reviews an AI diff in five checks: role, edges, contracts, assumptions, proof.
realpython.com/agentic-engin…
Anthropic is pausing new frontier model releases, while coding tools keep moving: Cursor is now Grok Build, and GitHub rebuilt Copilot code review.
Plus three new models to try 🧵
2
6
3,827
🛡️ Reflection's open-source Iris safety evals and safeguards
An open safety benchmark plus two guardrails, Iris Cyber Probe and Iris Content Guard, for teams shipping open-weight models.
Get stories like these in your inbox every weekday, free from the Real Python team:
realpython.com/ai-newsletter…
1
397
