Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Suggestion: make sequence and map interfaces more similar Date: Wed, 30 Mar 2016 19:45:58 -0700 Organization: A noiseless patient Spider Lines: 12 Message-ID: <874mbntleh.fsf@nightsong.com> References: <56f8836b$0$1602$c3e8da3$5496439d@news.astraweb.com> <56FA8C71.4050306@rece.vub.ac.be> <56fb677f$0$11121$c3e8da3@news.astraweb.com> <56fba7d3$0$1616$c3e8da3$5496439d@news.astraweb.com> <56fbc518$0$1593$c3e8da3$5496439d@news.astraweb.com> <56fbf73d$0$1591$c3e8da3$5496439d@news.astraweb.com> <56fc8e09$0$1600$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ac130717aa033f117b1251f50cb4c61b"; logging-data="12892"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+c86S9ILCfszb7OmQnRASx" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:sB40Cq61LvPWyg9cQCi8/sHshyw= sha1:MmPVdWVM+X+nxBuVY2QreyJw7j0= Xref: csiph.com comp.lang.python:106122 Steven D'Aprano 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.