I think what you're really looking for is polymorphism. Since python
won't do multiple dispatch (not without slowly interpreting a heinous
syntax embedded in strings) then you're actually looking at a method
chain:
template('/some/template').render()
fragment('/some/template').render()
literal_response('<h1>some string</h1>').render()
Presto, .render is your unified interface. You could even make
responses it a capital-I Interface and adapt() them or introspect them
or whatever, if you want. Creating a compatibility API becomes a
trivial exercise.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---