Live data from Hacker News

Python Modern Practices

stuartellis.name

21–30 of 56 posts

Re: Python Modern Practices

#22
what are the pros and cons with pydantic models vs data classes? i like the runtime validation in pydantic models. the pattern i landed on is that 1) only use primitive data types such as str, int, pydantic models and pandas dataframes to present data. 2) no classes with methods, no polymorphism, only use module functions.

Re: Python Modern Practices

#23
post #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..."

For Python package management there are no good whys.

Re: Python Modern Practices

#25

For what it's worth, I still prefer to use pip, python -m venv and virtualenvwrapper. Solves 99% of the issues with 1% of the complexity

I prefer that for environment-oriented usage (literally I just need this stuff on my pythonpath pls) vs poetry I use for project oriented use.

Re: Python Modern Practices

#26
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.

Python packaging has always been a mess, and will probably always be. The reasons are mostly sociological.

Re: Python Modern Practices

#28
Curious why there is no mention of conda and its fast alternative mamba (micromamba). In my experience, conda is much more robust in managing. dependencies conflict (thanks to AWS and especially boto3) compared to pip.

Re: Python Modern Practices

#29
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.

Agree, I'm a poetry person too. I feel like TFA might be getting ahead of itself on this point. Just because something was ratified as a "standard" doesn't immediately make everything prior irrelevant.

Re: Python Modern Practices

#30
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.

[deleted]
Post reply on HN