Web Services Made Easy (WSME) "simplifies the writing of REST web services by providing simple yet powerful typing, removing the need to directly manipulate the request and the response objects". WSME allows you to describe the resources exposed by your service using python classes. WSME seems to require that you do so using class variables like:
class Person(wsme.types.Base):
lastname = wsme.type.wsattr(unicode)
firstname = wsme.type.wsattr(unicode)
Doing it this way allows WSME to use the class object as a template for marshalling and unmarshalling instances of that class. You then use instances of this class in WSME-decorated code and WSME does the work of unmarshalling and marshalling (respectively) request and response bodies.
However I have some concerns about the thread safety of any services built using WSME in this fashion. If a service receives two GET requests for different "person" resources more or less simultaneously, it seems to me that the threads servicing these requests run the risk of overwriting each other's "lastname", "firstname", etc. attributes. Even if the code were correctly written to use separate, local instances of the Person class, the fact that these attributes are defined at the class level means that they are shared by all instances of that class.
I'm hoping that there is something lacking in my understanding of either WSME or python that is causing me undo concern. What do people think? Is this really an issue or is there something I'm missing?