Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Suggestion: make sequence and map interfaces more similar Date: Tue, 29 Mar 2016 23:38:37 -0400 Lines: 18 Message-ID: References: <56f8836b$0$1602$c3e8da3$5496439d@news.astraweb.com> <56FA8C71.4050306@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de CK9ZiRlu6wR4B1+g6vRCJQLAtfYp07V5P62bSc3UvYQg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'dict': 0.09; 'received:internal': 0.09; 'violates': 0.09; 'contract.': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:10.202.2.212': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'subject:interfaces': 0.16; 'subject:make': 0.16; 'wrote:': 0.16; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'tue,': 0.34; 'so,': 0.35; 'mapping': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.61; 'subject:more': 0.61; 'mar': 0.65; '789': 0.84; 'dict()': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=rgIo8z2N5fsIYckjDmOlNPKGA04=; b=z8/FqQ Aw5L8T4O5g7WVg8L1x1/rJxiMHKiPZSBCLBQmlEh6sBhO0s8OsY9+Q4HgTEJQseV JCY0XX65rT6iW3rL5P7pFTk4XI86+crKm5bRNUpkTv3053FpNcsuA+EcPvmFA0T2 1qrgBt0ksZrhkL6pRyuhi1HajGuk/Kiof1s5I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=rgIo8z2N5fsIYck jDmOlNPKGA04=; b=IeeLlFHGU9rtEpkRh9gh5/PIm8MbbAPTYHVbLlsZAJBUhkP hPfHFFbaMDtGsg5APld7tXDnhQrF7R8cDkWciOB6WkTSS6nreP3/BI75yN0/RJqB +GgQk2/bMZxID8111Esy7zfbnTWflKyWQ64DnBrvyJX5GlyXYEVDY8j88kDc= X-Sasl-Enc: SkAshnbDcpwdOxtaroAKFnHlTraqP9ZwsVhtaSS2MkHr 1459309117 X-Mailer: MessagingEngine.com Webmail Interface - ajax-c6542207 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106026 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.