Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6744

Re: scope of function parameters (take two)

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:two': 0.07; 'wrapper': 0.07; 'subject:parameters': 0.09; 'def': 0.12; 'am,': 0.14; 'wrote:': 0.14; 'subject:function': 0.16; '\xa0def': 0.16; 'tue,': 0.17; 'call.': 0.19; 'header:In-Reply-To:1': 0.21; 'keys': 0.23; 'reason,': 0.23; 'received:209.85.161.46': 0.23; 'received :mail-fx0-f46.google.com': 0.23; 'certainly': 0.25; 'received:209.85.161': 0.26; 'message-id:@mail.gmail.com': 0.28; 'strings.': 0.30; 'to:addr:python-list': 0.33; 'chris': 0.34; 'there': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'think': 0.38; 'subject:: ': 0.38; 'subject: (': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; '31,': 0.65; '10:34': 0.84; 'scenario': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=2n/5TG9VLUyfrZp4CRqv+Dl9MnwHoVAzO/5zumktPK0=; b=TN3JZNMMlppFmHncYz7Lklo3IVQa6hpZNIOcoged6d14ll8umbk4azrOkQVjCyaqyh 0B9W9oiRQXwgpGro+7+G6UOZQDYRil4odwaObWZda6HHi11+wq0j5XUkh6Mdu6L8BEAm Q6Gxbc2J84tUCR/u915qmhQNg8GkShH0Bx9VY=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=wQDtFWLTo6611i751Air3QpOb+o7WZd+clm6br2PjW2mo6WaC/sI2/qneJc6RXAW30 THF/Rj8ONWRrye4/92FElHcFh/3sJ7PZ7B8HfIlBh8g7aTfU73pwWZxxt88qNMFIN7SR ikyNdRzXZ/s7SKQwWUNm8LXmQqlaedIHWv6PE=
MIME-Version 1.0
In-Reply-To <BANLkTim65+8Cd3WidNNrxr22vWw65qQ+Qg@mail.gmail.com>
References <F8395F78-615E-4FBD-B6FC-1D6173EAEA45@mcgill.ca> <F4EAD1ED-563D-4D6E-A50C-68308A9F26B7@mcgill.ca> <BANLkTin5exEpDkE3on3BAaWwHOjpg_vC8g@mail.gmail.com> <6699AB10-988A-49AD-B7C1-6BAA2CC3D008@mcgill.ca> <BANLkTikH0S4TNAjZzfAj6mAQoTeXLYFpgQ@mail.gmail.com> <BANLkTikVniZv-wP2pQhVs7BrsBeesFudgQ@mail.gmail.com> <BANLkTim65+8Cd3WidNNrxr22vWw65qQ+Qg@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 31 May 2011 11:10:58 -0600
Subject Re: scope of function parameters (take two)
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2324.1306861890.9059.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 82.94.164.166
X-Trace 1306861891 news.xs4all.nl 49179 [::ffff:82.94.164.166]:42865
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:6744

Show key headers only | View raw


On Tue, May 31, 2011 at 10:34 AM, Chris Kaynor <ckaynor@zindagigames.com> wrote:
> Is there any reason not to simplify this to:
> def copy_args(f):
>    @functools.wraps(f)
>    def wrapper(*args, **kw):
>        nargs = copy.deepcopy(args)
>        nkw = copy.deepcopy(kw)
>        return f(*nargs, **nkw)
>    return wrapper

No reason, good call.

> It means you will copy the keys as well, however they will (almost)
> certainly be strings which is effectively a no-op.

I think the keys will certainly be strings.  Is there any scenario
where they might not be?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: scope of function parameters (take two) Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-31 11:10 -0600

csiph-web