Howdy!

> Thanks for your comments.

I've always wanted to play the devil's advocate.  :^)

> Perhaps, it's once of the cases that practicality beats purity.  
> IMO, expecting our users to do tricks like (["Yes", "No"] 
> [some_boolean]), or (bool and 'yes' or 'no') will turn off many  
> newbies.

No more difficult than having new users understand how a decorator  
works... or a list comprehension.  AFIK 'bool and trueval or  
falseval' is a standard Python idiom, much like the C/C++/PHP/etc.  
'bool ? trueval : falseval' statement.  It, at its core, functions  
the same, but also has fall-through capability (e.g. if trueval  
resolves to false, say, an empty string, it will cascade to the  
falseval.  I think.)

As for the list index boolean - I used it for along time, before  
discovering the many problems it has, specifically in the case of  
using values that might not exist.

The pipe or double-pipe syntax for calling functions would be unique  
to the templating engine, and users might wonder why Python doesn't  
include such a feature, esp. as KID is marketed as a very Python-like  
XML processor and describes ${} as "Python Expression  
Substitution"... not "funky template language substitution".  ;-)

> It might be a good solution indeed to pass a common set of  
> "formatting functions" through the tg namespace. Its mostly a trade- 
> off of purity and convenience.

Indeed, I would be much happier with this solution, and I already do  
pass several formatting functions of my own.  However, I'd like to  
see a feature like these double-pipe filters getting past Guido to be  
implemented in Python itself. XD

Have a great day,

Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to