[ZPT] dictionaries, has_key, and the test function

Troy Farrell troy@entheossoft.com
Fri, 13 Dec 2002 16:05:38 -0600


+1 for finesse.  Good job Geir.

Geir B=E6kholt wrote:
> Hello Tim,=20
>=20
> Friday, December 13, 2002, 10:12:49 PM, you wrote:
>=20
>=20
>>I'd like to write something like:
>><span tal:define=3D"parents python:test(results.has_key('parents'), res=
ults['parents'], None)">
>>  do stuff
>></span>
>=20
>=20
>=20
> will this do ? :
>=20
>  <span tal:define=3D"parents python:results.get('parents',None)">
>=20
> =20