Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'iterate': 0.09; 'cc:addr :python-list': 0.10; 'wed,': 0.15; '24,': 0.16; 'cc:name:python list': 0.16; 'compare.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterable': 0.16; 'key?': 0.16; 'py3': 0.16; 'subject:key': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'am,': 0.23; '2015': 0.23; 'header:In- Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.28; 'dan': 0.29; 'subject:?': 0.34; 'received:google.com': 0.34; 'subject:: ': 0.37; 'chrisa': 0.84; 'to:none': 0.90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=tZn8yKQHQf+37UN1B+yV1uUwDL2MxxXxyMjawqqgW9U=; b=0I48KclUHQbk7JKRC0DQFbyfsEcGktocW2qrvyq9OjT14ywjPh8DXRAHLeOaGCAvYX 0WeiVKWYEx86BYS9egoKs9BFInYKY9ZnkG9BcnN5YOQPs8G4vm/C8RLc8CCEgnUqzNEY PCOffksq+VHpVa4PJGFbVxl8t8/l7zg9o8q54DGHetD7SS1i36+gTLjeeCsh16ciOAeC 6xXv3Ppnnmg9hDIiDyDKQnXYBu2xlOQQK+8ifuSJ/1G0c8Q5TfLtGmq1ORM+sB0uP2eT JYxuOzqNXjbDrFVSQbJiuXRWKYCrARHmUuvvJeRVUA0r1gnoepPQD3fKdwserBtK60TM LEWA== MIME-Version: 1.0 X-Received: by 10.50.176.228 with SMTP id cl4mr5898792igc.2.1435107723743; Tue, 23 Jun 2015 18:02:03 -0700 (PDT) In-Reply-To: References: <851th2t05t.fsf@benfinney.id.au> Date: Wed, 24 Jun 2015 11:02:03 +1000 Subject: Re: Looking up a dictionary _key_ by key? From: Chris Angelico Cc: Python List Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 6 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435107726 news.xs4all.nl 2840 [2001:888:2000:d::a6]:60638 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93055 On Wed, Jun 24, 2015 at 10:47 AM, Dan Stromberg wrote: > Would I have to do an O(n) search to find my key? Iterate over it - it's an iterable view in Py3 - and compare. ChrisA