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


Groups > comp.lang.python > #6744 > unrolled thread

Re: scope of function parameters (take two)

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2011-05-31 11:10 -0600
Last post2011-05-31 11:10 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#6744 — Re: scope of function parameters (take two)

FromIan Kelly <ian.g.kelly@gmail.com>
Date2011-05-31 11:10 -0600
SubjectRe: scope of function parameters (take two)
Message-ID<mailman.2324.1306861890.9059.python-list@python.org>
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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web