Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runs': 0.10; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'through.': 0.16; 'thanks,': 0.17; 'thu,': 0.19; 'print': 0.22; 'url:home': 0.24; 'sort': 0.25; 'appreciated': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'dec': 0.30; 'statement': 0.30; 'subject:list': 0.30; 'gives': 0.31; 'code': 0.31; 'run': 0.32; 'charset:us-ascii': 0.36; "i'll": 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'list,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'first': 0.61; 'email addr:gmail.com': 0.63; 'name': 0.63; 'subject:!!!': 0.74; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: dict turn to list at runtime unexpected!!! Date: Fri, 05 Dec 2014 12:43:58 -0500 Organization: IISS Elusive Unicorn References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-68-179-216.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417801447 news.xs4all.nl 2889 [2001:888:2000:d::a6]:55035 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82010 On Thu, 4 Dec 2014 22:56:38 -0800 (PST), telnetgmike@gmail.com declaimed the following: >Why the following code gives me errors??? And why the print statement run 2 times? I'll be appreciated your helps, thanks, It runs twice because your "for tmp_kind" loop calls the function twice. It fails the second time because your sort operation returns a list, and you bound that list to the name of your dictionary the first time through. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/