Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'strings.': 0.07; 'python': 0.09; 'python:': 0.09; 'dictionaries': 0.16; 'hashable': 0.16; 'keys.': 0.16; 'mark.': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'wrote:': 0.17; 'define': 0.20; 'java': 0.21; 'keys': 0.22; "i've": 0.23; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; "doesn't": 0.28; 'objects': 0.29; "i'm": 0.29; 'could': 0.32; 'to:addr:python- list': 0.33; 'pm,': 0.35; 'but': 0.36; 'useful': 0.36; 'subject:with': 0.36; 'subject:: ': 0.38; 'object': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'your': 0.60; 'fact,': 0.69; 'dict,': 0.84; 'wow': 0.84 Date: Mon, 18 Feb 2013 20:56:28 -0500 From: Mitya Sirenef User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Dictionaries with tuples or tuples of tuples References: <3752f235-1542-44c8-b7c7-93dfd98eac3f@googlegroups.com> In-Reply-To: <3752f235-1542-44c8-b7c7-93dfd98eac3f@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361238995 news.xs4all.nl 6886 [2001:888:2000:d::a6]:51641 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39167 On 02/18/2013 08:38 PM, Jon Reyes wrote: > Hi Mark. Well, doesn't iteritems() work the same? or am I missing something? By the way I'm sure I read the dictionaries part of Python but I'm unsure if it would take int's as a key for dictionaries. I've been weaned on Java where the keys of hashmaps are always Strings. > > PS: Just checked, wow I could use ints as keys. Awesome! In fact, any hashable object can be a key in a dict, so you can define your own custom objects and use them as keys -- this can be extremely useful sometimes! -m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/ Oaths are the fossils of piety. George Santayana