Suggestion: make sequence and map interfaces more similar
Random832
random832 at fastmail.com
Tue Mar 29 23:38:37 EDT 2016
On Tue, Mar 29, 2016, at 20:56, Chris Angelico wrote:
> The map contract is this:
>
> x = StrangeDict()
> x[123] = 456
> ...
> assert x[123] == 456
>
> Your mapping does violate the map contract.
So, you can put *anything* in that "..."?
x = dict()
x[123] = 456
x[123] = 789
assert x[123] == 456
dict violates the map contract.
More information about the Python-list
mailing list