Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder5.xlned.com!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'see:': 0.07; 'args)': 0.09; 'subject:2.7': 0.09; 'subject:Help': 0.11; 'python': 0.11; 'callable': 0.16; 'wrote:': 0.18; 'code,': 0.22; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'subject:from': 0.34; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; "didn't": 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'realize': 0.39; 'to:addr:python.org': 0.39; "you'll": 0.62; 'map': 0.64; 'different': 0.65; '26,': 0.68 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:to :content-type; bh=6IFXFXDFXIAG0pZcj6gZCLriSFYrCS9hGvod1A5LiWA=; b=NYOySFLQ7Ng8jovP22NISyumqBV+OK6jPYq4EysivwI6ySueU7h8HbR4AYfZ+DwN8+ sFd14+gNGzBtpF7Cx/x0hDbBK1lesSJkbFVdsmtv/XwPvGKStcq1gZV4iMo1OLlljZ5J h1Ys1y5o54ADdGjRJf5+a4TOF+aKAJQfv2ElqnupmVgzuKvoUGrW5VL+pWw0gJvK3q4c r+FQ0wM29mFEFAeJgzI3TKctvp93+3R9q5GY+3q3CTGToNIGE3YIsepaLCxhrxdhs6DT HN06SApoGm0YJmGVUkv28pCETW+dyacm+LdY6PTTAqbnt3p6+hGJDR5urudOdFRqDXFP l8mg== MIME-Version: 1.0 X-Received: by 10.68.170.66 with SMTP id ak2mr18298202pbc.5.1398525232465; Sat, 26 Apr 2014 08:13:52 -0700 (PDT) In-Reply-To: References: <9fb27984-1b9e-402b-aa4d-7ca4f26e2386@me.com> Date: Sat, 26 Apr 2014 11:13:52 -0400 Subject: Re: Help with changes in traceback stack from Python 2.7 to Python 3.x From: Ian Kelly To: Python Content-Type: multipart/alternative; boundary=047d7b86d55cb0cf0904f7f38792 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1398525241 news.xs4all.nl 2877 [2001:888:2000:d::a6]:47568 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70633 --047d7b86d55cb0cf0904f7f38792 Content-Type: text/plain; charset=UTF-8 On Apr 26, 2014 8:12 AM, "Ned Batchelder" wrote: > Looking at your code, I see: > > > tplArgs = map(None, lstVarNames, args) > > I didn't realize map accepted a callable of None (TIL!), but it no longer does in Python 3. You'll have to do this a different way. The Python 3 replacement for map(None, ...) is itertools.zip_longest. --047d7b86d55cb0cf0904f7f38792 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Apr 26, 2014 8:12 AM, "Ned Batchelder" <ned@nedbatchelder.com> wrote:
> Looking at your code, I see:
>
>
> =C2=A0 =C2=A0 tplArgs =3D map(None, lstVarNames, args)
>
> I didn't realize map accepted a callable of None (TIL!), but it no= longer does in Python 3. =C2=A0You'll have to do this a different way.=

The Python 3 replacement for map(None, ...) is itertools.zip= _longest.

--047d7b86d55cb0cf0904f7f38792--