[Python-ideas] Add a method to get the subset of a dictionnary.
Terry Reedy
tjreedy at udel.edu
Wed Oct 12 18:03:59 EDT 2016
More information about the Python-ideas mailing list
Wed Oct 12 18:03:59 EDT 2016
- Previous message (by thread): [Python-ideas] Add a method to get the subset of a dictionnary.
- Next message (by thread): [Python-ideas] Add "equal" builtin function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/12/2016 5:52 PM, Terry Reedy wrote:
> On 10/12/2016 12:06 PM, Enguerrand Pelletier wrote:
>> b = {k, v for k,v in a.items() if k in interesting_keys}
>
> Test code before posting. The above is a set comprehension creating a
> set of tupes.
I should have followed my own advice. The above is a SyntaxError until
'k,v' is wrapped in parens, '(k,v)'.
--
Terry Jan Reedy
- Previous message (by thread): [Python-ideas] Add a method to get the subset of a dictionnary.
- Next message (by thread): [Python-ideas] Add "equal" builtin function
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list