Hacker News new | past | comments | ask | show | jobs | submit login

Great job. I recommend Flask to everyone who wants a clean and modern framework that is simple to use and manage/deploy.

I'm also planning to write a series on how to build a simple SAAS with flask, hope some will find that interesting.




Flask is using globals everywhere, and for very long time did not support Python 3.x.


Although most of the methods are globally bound to the current request, Flask is thread safe and I can't see any problem with it. (except that it encourages beginners to use globals, which might be process and thread-unsafe).


I really don't see any benefit or sense in the Flask way of exposing request state through imported globals. It makes testing of views unnecessarily complex: you have to either patch the import or set up the thread local context in every test. And like you mentioned, it encourages unnecessary coupling.

It would be so much simpler to just have a request argument passed to each view.


But then you have to explicitly pass the context to everything you call.

Dynamic scoping would solve this problem (and similar problems, like dependency injection), but Python doesn't have that.

Flasks way emulates it as well as possible.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: