> Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros That's kind of very optimistic evaluation - literally anything beyond "import json" will likely lead you into the abyss of virtual envs. Running something created with say Python 3.13.x on Ubuntu 22.04 or even 24.04 (LTSs) / Rocky 9 and the whole can of worms opened. things like vir…
I'm switching to Python and actually liking it
411–420 of 718 posts
Re: I'm switching to Python and actually liking it
#412> 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…
Am I the only one who actually likes setting up new projects? I don't want to automate that.
If you work at an agency or as a freelancer and you build various similar apps with similar tooling and base setup, being able to scaffold and have them all setup quickly, not having to do it manually and waste hours id important. Similarly, if you work on various small open source packages, you want the tooling to be the same, READMEs look the same, etc, a script or tool to “spit out” the basic structure can be nice.
On the other hand, if you set up the app or larger open source package and you’ll work only on that project for potentially years, setting up a project individually, organically makes a lot of sense.
Re: I'm switching to Python and actually liking it
#413Earlier quoted context omitted.
“import json” is the kind of thing which requires picking and installing libraries in batteries-not-included languages, and it’s just one of many modules which are in the standard library. That’s not a compelling basis for large projects but over the years I’ve shipped a ton of useful production code which never needed more than the stdlib and thus spent no time at all thinking about deployment or security patching.…
The official package manager is pip, it's broken, and there has been a new "permanent solution" replacement for it each year.
Re: I'm switching to Python and actually liking it
#414Earlier quoted context omitted.
You should always use virtual envs. They're a single directory, how are they an abyss? Pip now complains if you try to install a package system wide.
I don't have to deal with this in JS or I think in other stuff like Golang. I give someone a package.json with versions of everything. npm install always sets deps up locally, but doesn't need to copy the entire NodeJS runtime.
If we use uv from TFA, like the commands are nearly 1:1:
npm install uv sync
npm install foo uv add foo
> It doesn't have to also store a local copy of NodeJS… which Node devs do have a thing for, too, called nvm, written in bash.
Re: I'm switching to Python and actually liking it
#415Earlier quoted context omitted.
The official package manager is pip, it's broken, and there has been a new "permanent solution" replacement for it each year.
“broken” is hyperbole. It works fine for millions of people every day. If you have some specific scenarios where you want it be better, it’s better to say those rather than just complain about an open source project.
Re: I'm switching to Python and actually liking it
#416Earlier quoted context omitted.
> A programming language that’s only good for What a bunch of crap. It's so trivial to show very popular and useful programs written in Python that far exceed this number I'm not even going to do the work. What a lazy criticism.
Hi rsyring, I made this comment out of experience. As python projects grow and grow, you need to do lots of support work for testing and even syntactic correctness. This is automatic in compiled languages where a class of issues is caught early as compile errors, not runtime errors. Personally I prefer to move more errors to compile time as much as possible. Dynamic languages are really powerful in what you can do at…
In hindsight, I should have just left it alone and not replied which is what I usually do. But Python's popularity isn't an aberration. It's tradeoffs make sense for a lot of people and projects. The low effort bad faith swipes at it from subsections of the HN community got me a bit riled today and I felt I had to say something. My apologies for a less than constructive critique of your comment.
Best.
Re: I'm switching to Python and actually liking it
#417Earlier quoted context omitted.
I don't have to deal with this in JS or I think in other stuff like Golang. I give someone a package.json with versions of everything. npm install always sets deps up locally, but doesn't need to copy the entire NodeJS runtime.
… node_modules is your venv. If we use uv from TFA, like the commands are nearly 1:1: npm install uv sync npm install foo uv add foo > It doesn't have to also store a local copy of NodeJS … which Node devs do have a thing for, too, called nvm, written in bash .
Re: I'm switching to Python and actually liking it
#418Maybe I'm the only one that finds Python simultaneously verbose and lacking? Either you need 500 dependencies to do something in a simple way, or you need dozens (if not hundreds) of lines to do trivial things. I avoid writing Python because there's so much bullshit to add. Much prefer Perl, I can actually get things done quickly. Python feels like programming for the sake of programming.
Python lets you just nest data structures without having to twist your brain. You want a tuple in a list in a dictionary value: you just write it down and can access it with a unified notation. Bam. No reference madness and thinking about contexts. It's a big part of what I typically need to get things done quickly and understand how I did it 5 years later. That has to count for something. Python is boring in that sense, Perl is fun. But that's exactly my problem with it. It's too clever for it's own good and writing it does things to your brain (well at least mine).
Re: I'm switching to Python and actually liking it
#419Earlier quoted context omitted.
I have been sticking with poetry for a while, now. What would make me want/need to move to uv?
Maybe you'll find this series of articles interesting: https://www.loopwerk.io/articles/tag/uv/
I'm very fortunate that my python projects are all relatively small, so maybe that colors things a bit. Certainly looks like something that would have swayed me to uv at the start, but as things are, I think I mainly just wish there was a more standard/accepted work flow for build and release.
Re: I'm switching to Python and actually liking it
#420Earlier quoted context omitted.
> Oddly enough It's not that odd, since it's the only situation where you cannot keep it bounded, unless you enjoy having variables that may or may not be defined (Heisenberg variable?), depending on whether the exception has been raised or not? Compare with the if statement, where the variable in the expression being tested will necessarily be defined.
While somewhat true, what would this be bound to? for i in range(0): pass
Is there any chance this would cause trouble though? Furthermore, what would be the need of having this variable accessible after the except block? In the case of a for block, it could be interesting to know at which point the for block was "passed".
So, maybe "None" answers your question?