3 ms·
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
by mpdehaan2 10y ago
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.
- ctoth 10y agoFrom 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).
- safewayclubcard 10y agoI 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.