Hello, all.
I guess I'm just not seeing this dictionary pop() problem you're having.
What version of Python are you using? Is there something I'm missing?
If I've made an obvious oversight, please forgive me and explain.
Thanks!
PyCharm (2023.1.1) REPL running Python 3.12:
25, 2024 2:56 AM
To: python-list@python.org
Subject: Re: Popping key causes dict derived from object to revert to object
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
ython-list@python.org
Subject: Re: Popping key causes dict derived from object to revert to object
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
> s
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, but
"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.
>
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
> leav
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 contex
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') for
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 co
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 consider the odd concept of w
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.
> Seem like there is no such function.
Yes, there is. You can do that with either pop or del:
>>> d =
Mark Bourne writes:
> Loris Bennett wrote:
>> Hi,
>> I am using SQLAlchemy to extract some rows from a table of 'events'.
>> From the call to the DB I get a list of objects of the type
>>sqlalchemy.orm.state.InstanceState
>> I would like to print these rows to the terminal using the
>> 'tabu
Loris Bennett wrote:
Hi,
I am using SQLAlchemy to extract some rows from a table of 'events'.
From the call to the DB I get a list of objects of the type
sqlalchemy.orm.state.InstanceState
I would like to print these rows to the terminal using the 'tabulate'
package, the documentation for
Loris Bennett wrote at 2024-3-21 10:56 +0100:
> ...
>So as I understand it, I need to convert the InstanceState-objects to,
>say, dicts, in order to print them. However I also want to remove one
>of the keys from the output and assumed I could just pop it off each
>event dict, thus:
>
>event_d
14 matches
Mail list logo