-1 on this new functionality
Referring again to PEP 3106, and its support for views - this was inspired
by the functionality seen with java.util.Map. Now that dict is sort of like
java.util.LinkedHashMap - albeit safe for concurrent operations* - it's
worth exploring if there's anything in the exp
On 07.07.20 19:41, Stephen J. Turnbull wrote:
Dominik Vilsmeier writes:
> Well, the point is that this "except comparisons" is not quite true:
>
> >>> i = {'a': []}.items()
> >>> s = {('a', 1)}
> >>> i == s
> TypeError: unhashable type: 'list'
>
> If passed a
On 07.07.20 19:09, Christopher Barker wrote:
On Tue, Jul 7, 2020 at 6:56 AM Dominik Vilsmeier
mailto:dominik.vilsme...@gmx.de>> wrote:
Well, the point is that this "except comparisons" is not quite true:
>>> i = {'a': []}.items()
>>> s = {('a', 1)}
>>> i == s
On 07.07.20 17:37, Inada Naoki wrote:
On Tue, Jul 7, 2020 at 10:52 PM Dominik Vilsmeier
wrote:
Surely that must be a relic from pre-3.7 days where dicts were unordered
and hence order-based comparison wouldn't be possible (though PEP 3106
describes an O(n*m) algorithm). However the current beh
Dominik Vilsmeier writes:
> Well, the point is that this "except comparisons" is not quite true:
>
> >>> i = {'a': []}.items()
> >>> s = {('a', 1)}
> >>> i == s
> TypeError: unhashable type: 'list'
>
> If passed a set as `other` operand, dict_items seems to decide to
On Tue, Jul 7, 2020 at 6:56 AM Dominik Vilsmeier
wrote:
> Well, the point is that this "except comparisons" is not quite true:
>
> >>> i = {'a': []}.items()
> >>> s = {('a', 1)}
> >>> i == s
> TypeError: unhashable type: 'list'
>
> If passed a set as `other` operand, dict_item
On Tue, Jul 7, 2020 at 10:52 PM Dominik Vilsmeier
wrote:
>
> Surely that must be a relic from pre-3.7 days where dicts were unordered
> and hence order-based comparison wouldn't be possible (though PEP 3106
> describes an O(n*m) algorithm). However the current behavior is
> unfortunate because it
The official doc of the partial function from the functools stdlib module says
it "is used for partial function application which “freezes” some portion of a
function’s arguments and/or keywords resulting in a new object with a
simplified signature".
However, whereas positional arguments are ef
On 05.07.20 16:56, Stephen J. Turnbull wrote:
Steven D'Aprano writes:
> Regarding your observation that dict views behave poorly if they
> have unhashable values, I agree, it is both odd and makes them less
> useful. Possibly at some point between the PEP and the release of
> the featur
On 06/07/2020 10:44, Federico Salerno wrote:
On 05/07/2020 23:55, Rob Cliffe wrote:
I don't think the new function should be restricted to numbers.
There may be uses for strings, or for user-built classes; why
restrict it unnecessarily?
If it quacks like supporting __lt__ and __gt__, it's
10 matches
Mail list logo