Live data from Hacker News

What new Python features are the most useful for you?

news.ycombinator.com

1–10 of 44 posts

What new Python features are the most useful for you?

#1
In recent years Python ecosystem evolved significantly. From using requirements.txt to dependency management tools like Poetry, from simple typing to Protocols [1] and Variadic Generics [2]. We've got walrus operator, match case statement, and finally even faster Python. More and more low-level libraries are being written in Rust [3].

What new features, tools, libraries (already implemented or being worked on) are the most useful for your work with Python? What are you the most excited about?

[1] https://peps.python.org/pep-0544/ [2] https://peps.python.org/pep-0646/ [3] https://github.com/pydantic/pydantic-core

Re: What new Python features are the most useful for you?

#2
- einops (probably by far the most useful Python dsl for me as of late, esp. if you deal a lot with tensors)

- numpy __array__ interface standardization (easy compatibility across a lot of numerical libraries, e.g. torch, awkward-array, zarr, jax.numpy, dask, xarray)

- the various jit compilers (e.g. numba, jax.jit, torch.compile)

- hw-accelerated functional programming style (e.g. functorch.vmap)

- pybind11 for easy af bindings to c++

- named dimensions for tensors

- pandas-compatible ecosystem (eg seaborn)

- pytrees

- pyenv

- mamba

What I really need, though, is a realtime successor to matplotlib with a much simpler interface/dsl. Haven't looked into plotly much but probably will try it soonish

Re: What new Python features are the most useful for you?

#4
post #2

- einops (probably by far the most useful Python dsl for me as of late, esp. if you deal a lot with tensors) - numpy __array__ interface standardization (easy compatibility across a lot of numerical libraries, e.g. torch, awkward-array, zarr, jax.numpy, dask, xarray) - the various jit compilers (e.g. numba, jax.jit, torch.compile) - hw-accelerated functional programming style (e.g. functorch.vmap) - pybind11 for easy…

Matplotlib is really killing me. I never have learned it properly and switch between methods to address the same things in Matplotlib. Every time I have to plot something I have to Google how to do it or I have a template ready already. In my opinion it’s the most annoying library I have to use.

Re: What new Python features are the most useful for you?

#5
post #2

- einops (probably by far the most useful Python dsl for me as of late, esp. if you deal a lot with tensors) - numpy __array__ interface standardization (easy compatibility across a lot of numerical libraries, e.g. torch, awkward-array, zarr, jax.numpy, dask, xarray) - the various jit compilers (e.g. numba, jax.jit, torch.compile) - hw-accelerated functional programming style (e.g. functorch.vmap) - pybind11 for easy…

Matplotlib is really killing me. I never have learned it properly and switch between methods to address the same things in Matplotlib. Every time I have to plot something I have to Google how to do it or I have a template ready already. In my opinion it’s the most annoying library I have to use.

[deleted]

Re: What new Python features are the most useful for you?

#7
In the 15 years I have been developing in python (and C++ at the same time, daily), I can't remember a single bug I ever had on account of an incorrect type.

I do like the := to save a few lines here and there.

3.10 does seem to run faster but maybe that is my imagination.

I wish more people would focus on writing good python.

Re: What new Python features are the most useful for you?

#8
post #2

- einops (probably by far the most useful Python dsl for me as of late, esp. if you deal a lot with tensors) - numpy __array__ interface standardization (easy compatibility across a lot of numerical libraries, e.g. torch, awkward-array, zarr, jax.numpy, dask, xarray) - the various jit compilers (e.g. numba, jax.jit, torch.compile) - hw-accelerated functional programming style (e.g. functorch.vmap) - pybind11 for easy…

Matplotlib is really killing me. I never have learned it properly and switch between methods to address the same things in Matplotlib. Every time I have to plot something I have to Google how to do it or I have a template ready already. In my opinion it’s the most annoying library I have to use.

In situations where matplotlib is the lingua franca, like notebooks, I've opted for seaborn. You'll still have to deal with matplotlib's complex nonsense, but substantially less of it.

Re: What new Python features are the most useful for you?

#9
post #7

In the 15 years I have been developing in python (and C++ at the same time, daily), I can't remember a single bug I ever had on account of an incorrect type. I do like the := to save a few lines here and there. 3.10 does seem to run faster but maybe that is my imagination. I wish more people would focus on writing good python.

3.11 runs a bunch faster.
Post reply on HN