Attrs – the Python library everyone needs (2016)
glyph.twistedmatrix.com
Attrs – the Python library everyone needs (2016)
1–10 of 115 posts
Re: Attrs – the Python library everyone needs (2016)
#2Re: Attrs – the Python library everyone needs (2016)
#3Voila!
Re: Attrs – the Python library everyone needs (2016)
#4Lots of love to Attrs, which is a great library and is a component of a lot of great software. It was my go-to library for years before Pydantic matured, but I think a lot of people have rightly started to move on to Pydantic, particularly with the popularity of FastAPI
Re: Attrs – the Python library everyone needs (2016)
#5see also "dataclasses" since python 3.7
Re: Attrs – the Python library everyone needs (2016)
#6my_point3d = (1.0, 2.5, 7.2) Voila!
What does your code do when I try my_point3d.x ?
Re: Attrs – the Python library everyone needs (2016)
#7see also "dataclasses" since python 3.7
Re: Attrs – the Python library everyone needs (2016)
#8IMO Pydantic is way more ergonomic, has great defaults, and easier to bend to your will when you want to use it a little differently. Lots of love to Attrs, which is a great library and is a component of a lot of great software. It was my go-to library for years before Pydantic matured, but I think a lot of people have rightly started to move on to Pydantic, particularly with the popularity of FastAPI
For any larger program, pervasive type annotations and "compile" time checking with mypy is a really good idea though, which somewhat lessens the need for runtime checking.
Re: Attrs – the Python library everyone needs (2016)
#9IMO Pydantic is way more ergonomic, has great defaults, and easier to bend to your will when you want to use it a little differently. Lots of love to Attrs, which is a great library and is a component of a lot of great software. It was my go-to library for years before Pydantic matured, but I think a lot of people have rightly started to move on to Pydantic, particularly with the popularity of FastAPI
Pydantic is dataclasses, except types are validated at runtime? It's nice and looks just like a normal dataclass looking at https://pydantic-docs.helpmanual.io/ For any larger program, pervasive type annotations and "compile" time checking with mypy is a really good idea though, which somewhat lessens the need for runtime checking.
I don’t expect any type-related thing to be remotely safe in Python without applying at least mypy and pylint, potentially pyright as well, plus, as always with an interpreted language, unit tests for typing issues that would be caught by a compiler in another language
Re: Attrs – the Python library everyone needs (2016)
#10IMO Pydantic is way more ergonomic, has great defaults, and easier to bend to your will when you want to use it a little differently. Lots of love to Attrs, which is a great library and is a component of a lot of great software. It was my go-to library for years before Pydantic matured, but I think a lot of people have rightly started to move on to Pydantic, particularly with the popularity of FastAPI
Pydantic is dataclasses, except types are validated at runtime? It's nice and looks just like a normal dataclass looking at https://pydantic-docs.helpmanual.io/ For any larger program, pervasive type annotations and "compile" time checking with mypy is a really good idea though, which somewhat lessens the need for runtime checking.