Suggestion: make sequence and map interfaces more similar

Paul Rubin no.email at nospam.invalid
Wed Mar 30 22:45:58 EDT 2016


Steven D'Aprano <steve at pearwood.info> writes:
> I want to see an actual application where adding a new key to a
> mapping is expected to change the other keys.

directory["mary.roommate"] = "bob"
directory["mary.address"] = None   # unknown address
...
directory["bob.address"] = "132 Elm Street"

Since Bob and Mary are roommates, they have the same address, so the
application might want to update both addresses once it learns one of
them.



More information about the Python-list mailing list