Proposal: let GaeoResponse inherit from webapp.Response

2 views
Skip to first unread message

pingooo

unread,
Dec 4, 2010, 9:48:37 PM12/4/10
to google-app-engine-oil
Hi list,

I searched the archive and didn't find discussions on the design of GaeoResponse class, so I'm posting this proposal. If this has been discussed before, please point me to the thread, thanks!

[Observation] Right now the GaeoResponse class inherits from object, and implements out, headers, cookie attributes and set_status(), clear(), wsgi_write() methods. Besides the cookies attribute, it is identical to the webapp.Response class (http://code.google.com/appengine/docs/python/tools/webapp/responseclass.html).

[Proposal] Inherit from webapp.Response instead of from object.

Pros:
 - Less code.
 - More compatible: automatically gets new API of webapp.Response when there is one. An example of incompatibility now is the set_status method. The official signature is 
     def set_status(self, code, message=None)
   GAEO's signature is
     def set_status(self, status_code, message)
   If an application migrates from bare bone App Engine to GAEO, this is an incompatibility that may bite him.

Cons:
 - Automatically gets new API of webapp.Response when there is one - less control in our hands.

I think the pros outweighs the cons, what do you think?

cheers,
pingooo

Reply all
Reply to author
Forward
0 new messages