Live data from Hacker News

I'm switching to Python and actually liking it

cesarsotovalero.net

261–270 of 718 posts

Re: I'm switching to Python and actually liking it

#261
post #246

When 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....)

I think for a lot of us, it was very frustrating when it was being pushed with no real analog for the practices we had in other languages. Poetry used to be pushed as how to do dependency management, but it was not obvious that it was not necessarily your build manager, as well. Even today, I'm not entirely clear what the standard approach is for how to manage a project. :(

If I were to try again I'd go with uv, it seems way way better

Re: I'm switching to Python and actually liking it

#262
post #11

Earlier quoted context omitted.

Python's package management is OK. The main culprit is .so libraries Think JNI or cgo management.

I'll throw in BLAS and LAPACK. Fuck, what a nightmare it always has been to get scipy running. I've always ended up with a wild mix of conda and pip installed shit that just wouldn't work.

[dead]

Re: I'm switching to Python and actually liking it

#263
post #196
post #141

Earlier quoted context omitted.

I have a silly theory that I only half joke about that docker/containers wouldn't've ever taken off as fast as it did if it didn't solve the horrible python dependency hell so well. You know something is bad when fancy chrooting is the only ergonomic way of shipping something that works. My first taste of Python was as a sysadmin, back in 2012 or so, installing a service written in Python on a server. The dependency…

> However, uv has, at least for my beginner and cynical eyes, swept away most of the bullshit for me. uv is _much_ better than what came before. As someone who has only had only glancing contact with Python throughout my career (terrible experiences at jobs with conda and pip), uv feels like Python trying to actually join the 21st century of package management. It's telling that it's in Rust and clearly takes inspira…

The funniest thing for me is that you can use uv in mise to install Python cli programs in a surprisingly elegant manner.

Re: I'm switching to Python and actually liking it

#264

Earlier quoted context omitted.

this is solved by uv

> things like virtual envs I consider my point as still valid with UV, what you wanted to express? On UV specifically - say 'asdf' compiles python right on your system from official sources - means using your ssl libs for example. UV brings Python binary - I feel worried on this.

uv works just as well with whatever Python you want to bring -- you're not required to use the Pythons that uv is capable of installing on your machine.

Re: I'm switching to Python and actually liking it

#265

pydantic basemodel has made dataclasses redundant.

Dataclasses have the one massive benefit of not being an additional dependency.

This. You also don't really need Pydantic unless you're de/serializing data from external sources. A dataclass is perfectly cromulent if you're just passing around data internally.

Re: I'm switching to Python and actually liking it

#266
post #202

Earlier quoted context omitted.

There are private and public methods. Private methods are only supposed to be called within other methods, as in privately. Public methods are the ones that are normally called through the code, repl, by the user or whatever. You are not supposed to write `myclass.__add__(x)` anywhere except where you define the class itself and its methods.

There's actually 4 kinds: def foo(... # public def _foo(... # internal def __foo(... # munged def __foo__(... # magic Internal is more convention as the language doesn't really do anything with it, but it does with munged, and magic methods are specifically for things implemented in the language. Internal and munged don't exactly map to private and protected, but are kinda similar ish.

Oh right. I am not really into python, had read some doc about naming conventions some poitns.

In any case I actually like how one can use underscores to point on how exposed some method is supposed to be. Makes it simpler to actually know what to skip and what not.

Re: I'm switching to Python and actually liking it

#267

Said with a note of surprise? Made me think this is probably normally a Ruby developer indoctrinated against Python. The article doesn’t seem to say what they have come from.

So, if you don't fancy Python you must be labeled a Ruby developer? Weird take.

Re: I'm switching to Python and actually liking it

#268

I've avoided Python for a long time, but I'm getting roped in myself, mainly because certain tasks seem to require a lot less code than Java or Perl. That said, call me old-fashioned, but I really take issue with "curl $URL | bash" as an installation method. If you're going to use an install script, inspect it first.

do you also inspect binary installers?

Re: I'm switching to Python and actually liking it

#269
post #11
post #8

Python as a language is nice. Python's version and package management is nothing short of a nightmare.

Python's package management is OK. The main culprit is .so libraries Think JNI or cgo management.

It is not okay (maybe uv fixes this?)

Re: I'm switching to Python and actually liking it

#270

"And guess what's the de facto programming language for AI? Yep, that sneaky one." Is this referring at all to to PyTorch. If not, any guesses what the author has in mind "Not only because the syntax is more human-friendly, but also because the Python interpreter is natively integrated in all Unix distros." Is this referring to GNU/Linux. UNIX (UNIX-like) includes more than Linux; some UNIX distributions do not inclu…

What is the reason you prefer not to simply let python lie around? Security?
Post reply on HN