Live data from Hacker News

Python Modern Practices

stuartellis.name

11–20 of 56 posts

Re: Python Modern Practices

#12
For many sections I'd ask myself "Why?" Sure, I know you can click on the links and do deeper research, but I'd love a quick "why" blurb for each section. Just a short "Why this is nice? Well, because..."

Re: Python Modern Practices

#13
post #10

Sad to not see Attrs mentioned. Dataclasses are cool, I guess, but Attrs is seriously great.

It's interesting to me that dataclasses seemed to be a slimmed down attrs but in practice I find it replaces namedtuple not attrs

For my use the key is how easily you can add simple conversion of values to attrs. IIRC this was intentionally omitted from dataclasses. For a 1-off using a factory with a dataclass is easy but repeated uses send me back to attrs

Re: Python Modern Practices

#14
post #11

I'm surprised the post doesn't mention uv, which did quite well on HN a few months ago. Any experience? https://github.com/astral-sh/uv https://news.ycombinator.com/item?id=39387641

I like using UV, it is painless, a proper in-place replacements and blazingly fast.

I have seen occasional hiccups, so we don't use it in prod just yet. But I use it in local all the time.

They've been responsive to issues, so give it a shot.

Re: Python Modern Practices

#15
post #10

Sad to not see Attrs mentioned. Dataclasses are cool, I guess, but Attrs is seriously great.

attrs looks interesting, can it be used in workflows for processing GBs of data? I don't see any Cython compatibility or other Python to compiled code options. I typically just get by with numpy recarrays, but I'm old fashioned and looking for something more modern.

Re: Python Modern Practices

#17
post #7
post #2

>Avoid using Poetry for new projects. Poetry predates many standards for Python tooling. This means that it uses non-standard implementations of key features, such as the dependency resolver and configuration formats in pyproject.toml files. What? This is the first I've heard of this.

pyenv? great! then just use pip with requirements.txt... what's wrong with pip freeze? why are there so many competing tools? it's very anti-python IMO.

> what's wrong with pip freeze?

I prefer my requirements.txt to include only the packages I install with pip myself (and not their dependencies).

Re: Python Modern Practices

#18
Has anyone tried orchestrating Python code using Elixir/Erlang? I feel like the true concurrency can only be achieved in the actor model of BEAM, and async still just does concurrent code, not parallel.

Re: Python Modern Practices

#19
post #2

>Avoid using Poetry for new projects. Poetry predates many standards for Python tooling. This means that it uses non-standard implementations of key features, such as the dependency resolver and configuration formats in pyproject.toml files. What? This is the first I've heard of this.

pyenv and poetry always my goto
Post reply on HN