|
From: Robert W. B. <rb...@di...> - 2001-02-14 14:50:23
|
Hi David, On Wed, 14 Feb 2001, David Syer wrote: > > -----Original Message----- > > From: Robert W. Bill [mailto:rb...@di...] > > Sent: 14 February 2001 02:45 > > To: jyt...@li... > > > 1. an interpreter instance per PyServlet- overkill? > > 2. extract and insert servlet and namespace into and from the interpreter > > for each request- messy? > > 3. execute the file, class, and servlet methods with Py.exec methods- > > visually appealing, but not common practice, maybe for a > > reason I thought :) > > > I'm sure there's a better way that I'm missing though. > > Again I think people are trying to make this more complicated than it needs > to be. In fact the Java classloading 'problem' that was discussed earlier > this week is the best solution to the namespace problem. I think all you > need to do is make a separate web-app for each namespace you need. I can't > think of why you'd want to break the python namespace convention within an > app. If that is wrong, please explain. Sorry about the confusion. Before PyServlet.class was a part of the util package, I was using my own tool called PyMapping, and referred to the .py files as PyServlets. My own invented lingo has created the confusion between PyServlet and .py files- sorry. The module global namespace of the .py files within a single webapp is what I meant to say for each reference to "PyServlet". No, I'm not trying to break the python namespace. Python namespace convention would be that a module global var named "foo" could be used in multiple modules safely as it would be unique to those modules. PyServlet treats all .py file's module globals as in a single namespace- *not* like python namespace convention. The idea was to fix namespaces to work as python folk expect them to work- module globals are safe in Python, why not in python servlets? Admittedly, this sense of convention may be the only advantage. Nobody on the lists sees it as valuable, I don't need it, and I just thought it would be nice if it was more like python. Not a big deal either way. -Robert |