Jussi Piitulainen <jussi.piitulai...@helsinki.fi>:

> But the most readable thing might be to have a function that extracts
> the sole value by whatever means:
>
>    >>> def sole(d): [o] = d.values() ; return o
>    ... 
>    >>> sole(shoe)
>    3.141592653589793

In the same vein:

   >>> def sole(d):
   ...   for o in d.values():
   ...     return o
   ... 
   >>> sole(shoe)
   3.141592653589793


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to