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: 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: References: <6699AB10-988A-49AD-B7C1-6BAA2CC3D008@mcgill.ca> From: Ian Kelly Date: Tue, 31 May 2011 11:10:58 -0600 Subject: Re: scope of function parameters (take two) To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Tue, May 31, 2011 at 10:34 AM, Chris Kaynor w= rote: > Is there any reason not to simplify this to: > def copy_args(f): > =A0 =A0@functools.wraps(f) > =A0 =A0def wrapper(*args, **kw): > =A0 =A0 =A0 =A0nargs =3D copy.deepcopy(args) > =A0 =A0 =A0 =A0nkw =3D copy.deepcopy(kw) > =A0 =A0 =A0 =A0return f(*nargs, **nkw) > =A0 =A0return 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?