Suggestion: make sequence and map interfaces more similar

Antoon Pardon antoon.pardon at rece.vub.ac.be
Thu Mar 31 03:52:10 EDT 2016


Op 31-03-16 om 04:40 schreef Steven D'Aprano:
> On Thu, 31 Mar 2016 06:07 am, Antoon Pardon wrote:
>
>>> Because fundamentally, it doesn't matter whether dicts are surjections or
>>> not. They're still many-to-one mappings, and those mappings between keys
>>> and values should not change due to the insertion or deletion of
>>> unrelated keys.
>> Repeating your opion without further arguments doesn't lend any support
>> to that opinion. If within the problem space you are working on, such a
>> change would make sense as a step to generate the next mapping from the
>> previous one, i don't see what the problem is if one could make use of
>> this.
>
> Enough of the hypothetical arguments about what one could do or might do.
> Let's see a concrete example of actual real world code used in production,
> not a mickey-mouse toy program, where it is desirable that adding or
> deleting one key will modify the rest of the keys in the mapping.

I am not going to humour your petitio principii. If you want to argue against
such a adjustment on the ground of some characteristics mappings should have,
you have to make your case yourself and not try to shift the burden onto
the person who has his doubt about your argument.

If you continously stress the adaption will loose the stability of mappings
and so suggest this is somehow a problem it is your burden to argue that
problem.

> Arguing for the sake of arguing about what somebody might want is not
> productive. Let's see some actual concrete use cases where you have a
> database or mapping between keys and values, say something like this:

Arguing by just calling attention to a specific characteristic but not
giving any reason why it would be bad if people were allowed to use a
mapping in a way that violated this characteristic, is not productive
either.

If you try to argue a principle problem with the proposal, you have
to support that and not try to shift the attention to there being no
use case for the moment.

-- 
Antoon Pardon.




More information about the Python-list mailing list