News for hackers. Stuff that matters.
Re:Using attrs for everything in Python by mpdehaan2 on Thursday August 25, 2016 @06:55PM (#12363125)
Hmm, IDK.

Stuff like @attr.ib is kind of cute looking. (This not being a good thing).

Though in reality, I'd probably want more explicit methods. If you are using something like Django REST framework, you can validate with the serializer. And sometimes you want to validate (often) the combination of variables and how they interact.

Kind of feels a little non-pythonic to me. Clever, but the ways it is changing things are stuff you have to unroll if the behavior grows, versus stuff you just add to.

Re:Using attrs for everything in Python by ctoth on Thursday August 25, 2016 @07:02PM (#12363155)
From the docs:

(If you don’t like the playful attr.s and attr.ib, you can also use their no-nonsense aliases attr.attributes and attr.attr).

Re:Using attrs for everything in Python by safewayclubcard on Thursday August 25, 2016 @08:20PM (#12363471)
I would consider that a negative.

> There should be one-- and preferably only one --obvious way to do it.

Whats going to happen when all professional code is using `attr.attributes` but all the documentation uses `attr.s`?

Anyway its a minor point. I personally think it is a poor decision when a programmer decides to be cute than clear.