Hello:

I wrote a "Hello World" sample refer to CherryPy Book and think about
how simplicity a turbogears' "Hello World" can be.

In that progress I found "turbogears.expose()" can always be replaced
by "expose()" with a explicit declaration in front of code:

"from turbogears import expose"

I'd like to throw a 6 lines turbogears Hello world sample here (It
could be decrese to 5 lines by "import *"):

    0 from turbogears import controllers
    0 from turbogears import expose
    1 class Root(controllers.RootController):
    2      @expose()
    3      def index(self):
    4          return "Hello World!"


with that declaration, I found use "@expose()" statement is more easy
to figure out than use "@turbogears.expose()",
and declaration in explicit way is also saving time for searching
matched class in python (interior).

Does any reason we should use default "@turbogears.expose()" ?

regards

Reply via email to