Why does list have no 'get' method?

grflanagan grflanagan at yahoo.co.uk
Mon Feb 11 04:35:30 EST 2008


On Feb 8, 4:24 pm, Matthew_WAR... at bnpparibas.com wrote:
> > > val = BETTER foo THAN bar
>
> > > ;-)
>
> > > Cobol-strikes-back-ly yours,
>
> > > George
>
> > I use a ETL language/tool that actually has a function for this kind
> > of thing:
>
> > NulltoValue(value,defaultValue)
>
> > it returns defaultValue if value is null otherwise value.
>
> even Ksh has one;
>
> val=${foo:=$bar}
>

An approximation in Python:

http://gflanagan.net/site/python/utils/RattlebagTemplate.py.html
http://gflanagan.net/site/python/utils/RattlebagTemplate.py



More information about the Python-list mailing list