writes:
> Loris wrote:
>
> "Yes, I was mistakenly thinking that the popping the element would leave
> me with the dict minus the popped key-value pair. Seem like there is no
> such function."
>
> Others have tried to explain and pointed out you can del and then use the
> changed dict.
>
> But
You should considered also announcing on https://discuss.python.org/ which is a
lot more active then this list.
Barry
> On 25 Mar 2024, at 04:13, Erik Max Francis via Python-list
> wrote:
>
> I'm pleased to announce the release of EmPy 4.1.
>
> The 4._x_ series is a modernization of the
I am glad, Lori, you found a solution another way.
Actually, Lori, I think you were right in looking for a built-in method that
complements pop() by returning everything else other than the item mentioned.
There are philosophical and practical considerations that were no doubt
considered and a
Lori,
The list comprehension you are thinking of does work if you change things a
bit. But it is not a great idea as a main purpose of a dict is that using a
hash means things are found in linear time. A comprehension iterates on all
values. If you wanted to select just some items to keep in a
"Michael F. Stemper" writes:
> On 25/03/2024 01.56, Loris Bennett wrote:
>> Grant Edwards writes:
>>
>>> On 2024-03-22, Loris Bennett via Python-list wrote:
>>>
Yes, I was mistakenly thinking that the popping the element would
leave me with the dict minus the popped key-value pair.
Grant Edwards writes:
> On 2024-03-22, Loris Bennett via Python-list wrote:
>
>> Yes, I was mistakenly thinking that the popping the element would
>> leave me with the dict minus the popped key-value pair.
>
> It does.
Indeed, but I was thinking in the context of
dict_list = [d.pop('a')
On 25/03/2024 01.56, Loris Bennett wrote:
Grant Edwards writes:
On 2024-03-22, Loris Bennett via Python-list wrote:
Yes, I was mistakenly thinking that the popping the element would
leave me with the dict minus the popped key-value pair.
It does.
Indeed, but I was thinking in the
On 2024-03-25, Loris Bennett wrote:
> "Michael F. Stemper" writes:
>
>> On 25/03/2024 01.56, Loris Bennett wrote:
>>> Grant Edwards writes:
>>>
On 2024-03-22, Loris Bennett via Python-list
wrote:
> Yes, I was mistakenly thinking that the popping the element would
>
On 2024-03-25, Loris Bennett via Python-list wrote:
> Grant Edwards writes:
>
>> On 2024-03-22, Loris Bennett via Python-list wrote:
>>
>>> Yes, I was mistakenly thinking that the popping the element would
>>> leave me with the dict minus the popped key-value pair.
>>
>> It does.
>
> Indeed,