Ben Bangert wrote: > On Dec 18, 2007, at 12:12 AM, Ben Bangert wrote: >> In controllers, I think we can do away with the 'from ... import *'. >> While this works nicely for awhile, it almost always tends to leave a >> bad taste on people's mouth. The default controller template could >> instead come with the only necessary import: > > Of course, those wanting to use 'from ... import *', no reason they > can't continue to use that. ;) > > I'm also looking at some of the locations for things, and since beaker > handles its own stacked object proxy, I'm thinking it might be cleaner > and less confusing if projects imported the session object from where > the package that provides it... beaker. So instead of: > > from pylons import session > > When you want sessions, you'd add: > from beaker.middleware import beaker_session as session
What about just subclassing webob.Response and adding a session property to it? Potentially this could be done in application packages themselves, in an application-specific subclass of Request. I actually think hanging lots of things off a app-local Request class is quite reasonable. One thing I haven't documented in WebOb is how the descriptors work, but I could write that up so it's clearer how to add new attributes. You can also add arbitrary attributes to the request which are all kept in one environ key. I also don't think indirection is bad, the problem is more "import *" specifically, because you can't backtrack through that very easily. And I kind of like the helpers module. I generally like the idea of comments that are helpful to new users, but I've also noticed that the comments get get left in forever. I don't know what the proper compromise is there. Can we setup pylint (or pyflakes or something) to complain specifically about these comments? -- Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en -~----------~----~----~----~------~----~------~--~---