Nice article, but this command doesn't activate the venv that's managed by uv. uv venv activate The command actually creates a new venv in a dir called "activate". The correct way to activate the venv is like this: source .venv/bin/activate
I'm switching to Python and actually liking it
611–620 of 718 posts
Re: I'm switching to Python and actually liking it
#612Out of curiosity, why would I use Dataclass vs a Pydantic Basemodel. If we did not have a PyDantic dependency I could imagine wanting to use Dataclass. But if I have it, why not use everywhere?
Unnecessary baggage if you don't need validation or serialisation. My rule of thumb is to use Pydantic if I need serialisation, otherwise I default to dataclasses.
On the other hand if I see a dataclass I can tell what it's purpose is by whether it's frozen or not etc.
Always strive for self-documenting code.
Re: I'm switching to Python and actually liking it
#613But weiting a processing pipeline with Python is frustrating if you have worked with C# concurrency.
I figured the best option is Celery and you cannot do it without an external broker. Celery is a mess. I really hate it.
Re: I'm switching to Python and actually liking it
#614Earlier quoted context omitted.
That's kind of the point. These methods are never meant to be called directly. They're used to desugar. I think it's fairly short sighted to criticize these. FWIW, I also did that the first time I wrote Python. Other languages that do similar things provide a useful transparency.
I don’t think anyone is criticizing its utility, just that the syntax of 2-5(?) underscores in a row isn’t something that is DX friendly.
I've had snippets in my editor for approximately 15 years at this point so I don't have to manually type any of the dunder methods. Would recommend!
Re: I'm switching to Python and actually liking it
#615When did Python go out of fashion? This is the second article I've seen talking about it as if it's some kind abomination. I get that it's not the shiny new thing, but I don't understand people hating on it. Is this just junior devs who never learned it, or is there some new language out that I missed? (And please don't tell me Javascript....)
Re: I'm switching to Python and actually liking it
#616> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet. I recommend cookiecutter for this. I have a few templates I've built with that which I use frequently: python-lib: https://github.com/simonw/python-lib click-app: https://github.com/simonw/click-app datasette-plugin: https://github.com/simonw/datasette-plugin llm-plugin: https://github.com/simonw/llm-p…
And to run cookiecutter do you still use pipx, or have you switched to `uv tool install`
Re: I'm switching to Python and actually liking it
#617Python has done an impressive job over the years of making steady robust improvements. The typing and tooling has just gotten better and better. There are still plenty of problems though, imho async is still a much bigger pain than it should be (compared to other runtimes with a very nice experience like go or elixir, even dotnet has been less pain in my experience). Overall I like python, but it mainly boils down to…
This interview from Brett Cannon (old core dev who worked on packaging, imports, the vscode python extension...) is eye opening:
https://www.bitecode.dev/p/brett-cannon-on-python-humans-and
The guy cares SO MUCH and they have so many things not to break you can feel the sense of passion and the weight of responsibility in everything he says.
Re: I'm switching to Python and actually liking it
#618Earlier quoted context omitted.
You don't generally want API keys accidentally recorded into someone's bash history.
What exactly is your threat model, where the attacker can read ~/.bash_history but can't execute (or capture output from) /usr/bin/env?
Re: I'm switching to Python and actually liking it
#619Just a small note on the code in the linked script: API_KEY = os.environ.get("YOUTUBE_API_KEY") CHANNEL_ID = os.environ.get("YOUTUBE_CHANNEL_ID") if not API_KEY or not CHANNEL_ID: print("Missing YOUTUBE_API_KEY or YOUTUBE_CHANNEL_ID.") exit(1) Presenting the user with "Missing X OR Y" when there's no reason that OR has to be there massively frustrates the user for the near zero benefit of having one fewer if statemen…
Re: I'm switching to Python and actually liking it
#620Funnily enough, I made the opposite switch recently, and am also liking it. My thoughts about python here: https://calvinlc.com/p/2025/06/10/thank-you-and-goodbye-pyth... Next time I get into Python I’ll try uv, ruff, ty.
uv + ruff (for formatting AND linting) is a killer combo, though.
And the more you use uv, the most you discover incredible stuff you can do with it that kills so many python gotchas like using it in the shebang with inline deps or the wonders of "--with":