Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'assign': 0.07; 'ignore': 0.13; 'passing': 0.15; '(x,': 0.16; 'appreciated!': 0.16; 'expects': 0.16; 'received:172.18.0': 0.16; 'to:name:python- list@python.org': 0.20; 'flags': 0.22; 'tuples': 0.22; 'skip:( 20': 0.28; 'noticed': 0.28; 'loop,': 0.29; 'str': 0.29; 'way?': 0.29; 'code': 0.31; 'to:addr:python-list': 0.33; 'there': 0.35; 'but': 0.36; 'guidance': 0.36; 'method': 0.36; 'item': 0.37; 'some': 0.38; 'to:addr:python.org': 0.39; 'help': 0.40; 'think': 0.40; 'received:unknown': 0.63; 'subject:better': 0.84; 'str.': 0.91 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=3f4U5fHrZLLPCzJ96ldNbjtja1zQ0ih230F6vdsLr5s= c=1 sm=1 a=P90J6pEA2ccA:10 a=KAdk4VP_izgA:10 a=7PYXob_7ZXMA:10 a=BLceEmwcHowA:10 a=8nJEP1OIZ-IA:10 a=xqWC_Br6kY4A:10 a=oNw28mxuUhXRB3mVwYQ4Ag==:17 a=SydWqukAaKltG-gpDEYA:9 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 From: "Joseph L. Casale" To: "python-list@python.org" Subject: A better way to accomplish loop Thread-Topic: A better way to accomplish loop Thread-Index: AQHOCVsrLFsl3eZXVkm77Ht3xjoYRQ== Date: Tue, 12 Feb 2013 19:59:40 +0000 Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.18.0.4] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360699255 news.xs4all.nl 6841 [2001:888:2000:d::a6]:51560 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38778 I have an issue with some code I have been passed:=0A= =0A= for (x, y) in [(a_dict1, a_tuple[0]), (a_dict2,=A0a_tuple[1])]:=0A= =0A= =0A= I only noticed it as PyCharm failed to assign the str type to y, whereas it= knew=0A= the tuples 0 and 1 item were type str.=0A= =0A= =0A= In the loop it flags the passing of y into a method that expects type str. = I can ignore=0A= it, but looking at the loop, I cant help but think there is a better way?= =0A= =0A= =0A= Any guidance would be appreciated!=0A= jlc=