Hi Ben,

I wholeheartedly agree and I like the idea of explicit session imports from
things like Beaker too so everything is explicit. The less work the user
has to do to find out what is actually going on the better in my view, even
if it makes Pylons *look* less like an integrated framework.

g should be renamed persist. The interesting thing about g isn't that it is
global, rather that the variables attached to it persist across requests.

No worries about changes to the book. I'd much rather everything in Pylons
was more explicit even if we have to re-write some examples.

Cheers,

James


Original Message:
-----------------
From: Ben Bangert [EMAIL PROTECTED]
Date: Tue, 18 Dec 2007 00:12:52 -0800
To: pylons-devel@googlegroups.com
Subject: Cleaning some house of imports and one letters


After talking with Ian Bicking a bit tonight, I'm finally fully sold  
on retiring the one-letter variable names from Pylons. The most likely  
replacement names:
c -> context
g -> ??? (as globals/global is already taken)
h -> GONE (import the modules you need, most ppl want similar  
functions and can't find them anyways, importing them teaches people  
where they are, and shows them what else they might want to use)

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:

from yourprojb.lib.base import BaseController

It's pretty trivial to add the:
from pylons import request
from pylons.templating import render

as desired.

This also means we could get rid of the somewhat awkward __all__  
export stuff hanging around in the base controller.

Pylons 0.9.7 will of course hang onto the one letter names and such  
for legacy, while 1.0 will drop them.

PS: So sorry Mike and James and anyone else working on the book, but I  
think this will really help, hopefully just a global search/replace in  
the text? :)

Any other thoughts/suggestions?

Cheers,
Ben

--------------------------------------------------------------------
mail2web.com - Microsoft® Exchange solutions from a leading provider -
http://link.mail2web.com/Business/Exchange



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to