Testing dictionary results with doctest

Paul Rubin http
Fri Oct 31 14:33:04 EDT 2008


Joe Strout <joe at strout.net> writes:
> 	>>> t.match( "The rain in Spain falls mainly on the train." )
> 	{'object': 'rain', 'location': 'Spain', 'subloc': 'train'}

You can compare dictionaries for equality:

>>> t.match( "The rain in Spain falls mainly on the train." ) == \
	{'object': 'rain', 'location': 'Spain', 'subloc': 'train'}
    True



More information about the Python-list mailing list