5 ms·
http://dev.pocoo.org/~mitsuhiko/didntknow.pdf http://dev.pocoo.org/~mitsuhiko/didntknow.pdf "Custom Ducks" and "Cached Properties" terrify me a bit. Not Python
by ak217 14y ago
http://dev.pocoo.org/~mitsuhiko/didntknow.pdf http://dev.pocoo.org/~mitsuhiko/didntknow.pdf
"Custom Ducks" and "Cached Properties" terrify me a bit. Not Pythonic (as in, not easily readable).
But on the whole, I take that back. I was looking through your talks and realized that was the only place I got that feeling, and also found http://dev.pocoo.org/~mitsuhiko/badideas.pdf http://dev.pocoo.org/~mitsuhiko/badideas.pdf which takes a stand against magic.
Edit: I still think arguments would be better (more explicit/readable) than globals (request, etc.) in Flask, but it's your module and I know you've considered the reasons to make it that way. And globals don't exactly qualify as magic.
- asksol 14y agoI love cached_property, and I don't see what makes it unpythonic. I don't consider it magic, it's just a small addition to the built-in property descriptor, and it makes the often repeated code easier to read. I'm sure it will be a common idiom very soon.