It's absolutely bonkers the extent to which you can be dynamic in this language.
It's the very reason why Django is so DRY.
It's absolutely bonkers the extent to which you can be dynamic in this language.
It's the very reason why Django is so DRY.
Why does get_attr get called? Oh because it begins with the word "get" and there's an attribute that defines a method field called "attr".
I use Django a lot and generally it's great. But I hate that you can't follow your code paths from start to finish on the surface. You have to know about how it works underneath. Meaning you can't just be a python + web server expert. You have to also be a Django expert. So I get non-Django experts reviewing code and they have no clue why things work or break.
Just an opinion. Not saying this is objectively wrong.
Its also for more complex stuff but then you have to grab additional libraries to do stuff like db management, migrations, serialization, etc.
Flask also has some, in my opinion, rather uncomfortablly unintuitive global scope stuff. Where responses aren't passed into the view function, they're available on the imported flask object.
I have made some really dynamic stuff (like 100 domains running off a single server with each of their data separate, and to add a new domain is a click away) . I can't imagine doing that with other frameworks
> get_attr
What the fuck is that?
Also, you might be interested in webpy
> “Django lets you write web apps in Django. TurboGears lets you write web apps in TurboGears. Web.py lets you write web apps in Python.” — Adam Atlas
if people think this is so magic, it's almost as if lisps, schemes, and prologs never existed.
I write quite a bit of Lisp, and the conclusion I've come to is that for 95% of software developers, Lisp, Scheme, and Prolog might as well not exist. Even here on HN, where I'd expect the bar to be a little higher, the amount of incorrect info posted about Lisp is pretty crazy.
I'm almost certain most people's only experience with Lisp(s) and Prolog was a week or two using it in their programming languages class at university.
And operator overloading has nothing to do with DRY, in fact it's generally better to avoid it except for in very niche situations, like adding __add__ to a matrix type.
https://www.agiliq.com/blog/2018/01/understanding-python-mag...