string % dictionary question

Erik Max Francis max at alcyone.com
Tue Sep 14 02:19:46 EDT 2004


Sam Sungshik Kong wrote:

> I want the result to be just empty string when the dictionary value is
> None.
> Is there a good way?

Best way is either subclass dict or write a simple wrapper object which
returns "" instead of None.  Or use EmPy :-).

-- 
 __ Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
/  \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ Nobody can reach me, nobody can touch me; it's a wonderful
    feeling. -- Aaliyah



More information about the Python-list mailing list