[Python-ideas] Enhancing dict.values

Paul Moore p.f.moore at gmail.com
Fri May 27 12:42:44 EDT 2016


On 27 May 2016 at 17:17, Steven D'Aprano <steve at pearwood.info> wrote:
> Open questions:
>
> - Is it worth making this a dict method? +1 from me.

Quite possibly, but maybe a 3rd-party function implementing this would
be a worthwhile test of how useful it is in practice (although
conceded, a big part of its usefulness would be that it doesn't need a
dependency).

> - Any other functionality?

Nested unpacking:

location = = { 'name': 'The north pole', 'position': { 'x': 0, 'y': 0 }}
location_name, x, y = location.getvalues('name', 'position.x', 'position.y')

Paul.


More information about the Python-ideas mailing list