The Morning I Realized DeepSeek V3 Writes Python Cleaner Than I Do
The Morning I Realized DeepSeek V3 Writes Python Cleaner Than I Do
It was around 7am, coffee not even halfway done, and I told myself I would just “test” a non-Claude model on a tiny script. Nothing serious. A 60-line Python file that pulls a CSV from one of my blog automation jobs, strips weird whitespace, and dedupes rows by a normalized title.
I picked DeepSeek V3 through OpenRouter because I kept seeing people on Reddit say it was punching way above its price. I was not prepared to actually agree with them by 7:30am.
Why I even bothered testing another model
Claude has been my daily driver for months. Claude Code rewrites half my Python before I finish typing the docstring. So when I open OpenRouter and pick something else, it feels almost disloyal, like I am cheating on a tool that has been quietly doing my job for me.
But I had been reading too many threads about DeepSeek V3 being shockingly good at code, and the curiosity got loud. After spending an hour on OpenRouter and realizing I had been paying too much, I figured a five-cent experiment was a fair price for an answer.
The script I gave it
The script was nothing special. It read a CSV of post titles and URLs, lowercased everything, stripped Korean and English punctuation, ran a fuzzy match for near-duplicates, and wrote a clean file back out. My version had a for loop nested inside another for loop, a helper function that returned a tuple I kept forgetting the order of, and three commented-out lines I had never deleted.
I pasted the whole thing into a single OpenRouter call to deepseek/deepseek-chat and asked it to refactor for clarity, not performance. I expected a polite reorganization. I got something else.
Reading its version line by line
DeepSeek pulled the normalization into a single pure function with a clear name. It replaced my nested loops with a dictionary keyed by the normalized title, which collapsed the dedup logic into about four lines. It used pathlib instead of my mess of os.path.join calls. It added type hints in places where I had been too lazy to add them.
None of this was fancy. It was just the version of the script a slightly more disciplined version of me would have written if I had three more cups of coffee and an hour of patience.
Eben’s note: The uncomfortable part was not that it was smarter than me. It was that it wrote what I already knew was correct, and I just had not bothered.
The moment I accepted the refactor wholesale
I sat there for maybe two minutes trying to find one thing to push back on. A naming choice, a missed edge case, anything. I found nothing. The variable names were better than mine. The function boundaries were cleaner. It even caught a bug where I was stripping punctuation before lowercasing, which broke on a few Korean titles with mixed casing in romanized parts.
So I copied it into the file, ran my pytest suite, and every test passed on the first try. I committed it. The commit message was honestly just “deepseek refactor, kept as is.” I felt a little weird about that, but not weird enough to undo it.
What this means for my Claude habit
I am not switching away from Claude. Claude Code is still the thing I lean on for anything inside an actual editor session, and the agent-shaped workflows I have built around it are not going anywhere. But I am clearly done with the assumption that one model is my answer for everything.
This connects to a feeling I had earlier when I got lost in 800,000 models on Hugging Face. The ecosystem is not one winner. It is a toolbox, and I have been using one hammer for everything because the hammer is excellent. DeepSeek V3 just reminded me there are other tools sitting right there.
The practical setup I landed on
By the end of the morning I had wired DeepSeek V3 into my OpenRouter config as a secondary option for one specific job: refactoring small standalone Python files before they go into the blog automation repo. Claude still drives the bigger agent loops. DeepSeek gets the cold-eyed cleanup pass.
It costs almost nothing per call. It runs on the same OpenRouter key I already had. The Mac mini does not even notice the extra traffic.
What I am taking from this
If you have been loyal to one model out of habit, spend five cents on a refactor with a different one. Pick a small, real script you actually use. Compare line by line. The point is not to find a new favorite. The point is to find the spots where your current favorite has been hiding your own laziness from you.
For me, that turned out to be a 60-line data cleaner I had stopped looking at honestly. DeepSeek V3 looked at it for the first time, and it was kinder to my code than I have been in months.
Related Posts
- I Spent an Hour on OpenRouter and Realized I’ve Been Paying Too Much
- The Afternoon I Tried Hugging Face and Got Lost in 800,000 Models
- The Day I Found r/LocalLLaMA and Lost Four Hours to Reading Strangers
Tags: #AIagents #ClaudeCode #OpenClaw #MacMini #OpenRouter #buildinginpublic #Eben