One of the most common errors/questions on Stack Overflow is some variant of "what does 'dict object is not callable' mean, how do I return JSON?" Now that #3111 is merged, returning dict from a view produces a JSON response. However, there are still plenty of other types that will produce that error, such as returning a bool, or a User object, or a list of rows from a database query.
Flask.make_response should check whether an otherwise unhandled value is a BaseResponse subclass or a callable before treating it as such. Then it can raise a more helpful error.
One of the most common errors/questions on Stack Overflow is some variant of "what does 'dict object is not callable' mean, how do I return JSON?" Now that #3111 is merged, returning
dictfrom a view produces a JSON response. However, there are still plenty of other types that will produce that error, such as returning abool, or aUserobject, or a list of rows from a database query.Flask.make_responseshould check whether an otherwise unhandled value is aBaseResponsesubclass or acallablebefore treating it as such. Then it can raise a more helpful error.