On Wed, 24 Feb 2021 at 15:02, Random832 wrote:
> On Wed, Feb 24, 2021, at 02:59, Marco Sulla wrote:
> > On Wed, 24 Feb 2021 at 06:29, Random832 wrote:
> > > I was surprised, though, to find that you can't remove items directly
> > > from the key set, or in general update it in place with &= or -
On Wed, Feb 24, 2021, at 02:59, Marco Sulla wrote:
> On Wed, 24 Feb 2021 at 06:29, Random832 wrote:
> > I was surprised, though, to find that you can't remove items directly from
> > the key set, or in general update it in place with &= or -= (these
> > operators work, but give a new set object)
On Wed, 24 Feb 2021 at 06:29, Random832 wrote:
> I was surprised, though, to find that you can't remove items directly from
> the key set, or in general update it in place with &= or -= (these operators
> work, but give a new set object).
This is because they are a view. Changing the key object
On Wed, Feb 24, 2021 at 4:29 PM Random832 wrote:
>
> AIUI the keys, values, and items collections have always had the ordering
> guarantee that iterating over them while not modifying the underlying
> dictionary will give the same order each time [with respect to each other,
> and possibly also
On Sat, Feb 20, 2021, at 15:00, dn via Python-list wrote:
> So, the output is not a set (as you say) but nor (as
> apparently-indicated by the square-brackets) is it actually a list!
To be clear, it is an instance of collections.abc.Set, and supports most binary
operators that sets support.
I wa
On 20/02/2021 20.25, Wolfgang Stöcher wrote:
> Having a dict like
> d = {'one': 1, 'two': 2}
> the representation of its keys
> repr(d.keys())
> gives
> "dict_keys(['one', 'two'])"
>
> But since the keys are unique, wouldn't a representation using the set
> notation
> be more intuitive, i.e.
On 2/20/2021 2:25 AM, Wolfgang Stöcher wrote:
Having a dict like
d = {'one': 1, 'two': 2}
the representation of its keys
repr(d.keys())
gives
"dict_keys(['one', 'two'])"
But since the keys are unique, wouldn't a representation using the set
notation
be more intuitive, i.e. what about c
Having a dict like
d = {'one': 1, 'two': 2}
the representation of its keys
repr(d.keys())
gives
"dict_keys(['one', 'two'])"
But since the keys are unique, wouldn't a representation using the set
notation
be more intuitive, i.e. what about changing the output of
dict_keys.__repr__ to