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


Groups > comp.lang.python > #33082

Re: Is there a simpler way to modify all arguments in a function before using the arguments?

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'arguments': 0.07; 'plenty': 0.07; 'other,': 0.09; 'subject:using': 0.09; 'def': 0.10; 'sat,': 0.15; 'contrived': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'headers,': 0.16; 'subject: \n ': 0.16; 'whatever,': 0.16; 'wrote:': 0.17; 'headers': 0.17; 'received:209.85.214.174': 0.21; 'body,': 0.22; 'header': 0.24; 'paul': 0.24; 'header:In-Reply- To:1': 0.25; 'handling': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'represent': 0.28; 'dictionary': 0.29; 'writes:': 0.29; 'subject:all': 0.29; "i'm": 0.29; 'keyword': 0.30; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'nov': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'modules': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'header:Received:5': 0.40; 'to,': 0.65; 'subject:there': 0.65; 'subject:before': 0.84
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=6NBKHLtU4M6O/q+XojtuSMf8ckbqAHegmSnDq7e1a3Q=; b=oN8rEcwUBRF2pob1/M9nlDJFNyik3d2hV6wl+ue1hJ0rJ+S1UV/MAZas54mRK/T+zz 5Xet7H+bzNPa7qcMekNvTDXByE7fjWt5FgWvQhqOwrvyJJPT+XFqeAFa23HGedVQI7qI Op+JpD+iJJ/sYh5i3+RQ+PXvKhO6I1NIge1u19Qh8t3YCuiwuv4PGMeQo5SsSbQzeb4x h6fgM0d8T0nxgqPwW+71Y1e7oA0muMtRvkBNthsKlLoVZmmhMqiVejJKZyuFqu+6YDiO 5ePBBYyrrsxdcRWvHAVAJVf5Gpr/TpTekHJ5pjRT3L/in/FLzwGfZayHx93m1AtRB/Tl jKqw==
MIME-Version 1.0
In-Reply-To <7x390iw19i.fsf@ruckus.brouhaha.com>
References <18134e77-9b02-4aec-afb0-794ed900d194@googlegroups.com> <7xlieadv9o.fsf@ruckus.brouhaha.com> <mailman.3529.1352519803.27098.python-list@python.org> <7x390iw19i.fsf@ruckus.brouhaha.com>
Date Sat, 10 Nov 2012 20:19:11 +1100
Subject Re: Is there a simpler way to modify all arguments in a function before using the arguments?
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.3532.1352539154.27098.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1352539154 news.xs4all.nl 6904 [2001:888:2000:d::a6]:60013
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33082

Show key headers only | View raw


On Sat, Nov 10, 2012 at 3:05 PM, Paul Rubin <no.email@nospam.invalid> wrote:
> Chris Angelico <rosuav@gmail.com> writes:
>> Contrived example:
>> def send_email(from, to, subj, body, whatever, other, headers, you, like):
>
> That should be a dictionary with the header names as indexes.  In fact
> there are already some email handling modules in the stdlib that
> represent headers that way.

That's also plausible, but keyword arguments do make sense. And this
was a top-of-the-head contrived example; I'm sure there are plenty of
good use-cases.

ChrisA

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


Thread

Is there a simpler way to modify all arguments in a function before using the arguments? bruceg113355@gmail.com - 2012-11-09 16:48 -0800
  Re: Is there a simpler way to modify all arguments in a function before using the arguments? Roy Smith <roy@panix.com> - 2012-11-09 20:05 -0500
    Re: Is there a simpler way to modify all arguments in a function before using the arguments? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-10 01:16 +0000
      Re: Is there a simpler way to modify all arguments in a function before using the arguments? bruceg113355@gmail.com - 2012-11-10 05:15 -0800
        Re: Is there a simpler way to modify all arguments in a function before using the arguments? Chris Angelico <rosuav@gmail.com> - 2012-11-11 05:33 +1100
  Re: Is there a simpler way to modify all arguments in a function before using the arguments? Paul Rubin <no.email@nospam.invalid> - 2012-11-09 18:52 -0800
    Re: Is there a simpler way to modify all arguments in a function before using the arguments? Chris Angelico <rosuav@gmail.com> - 2012-11-10 14:56 +1100
      Re: Is there a simpler way to modify all arguments in a function before using the arguments? Paul Rubin <no.email@nospam.invalid> - 2012-11-09 20:05 -0800
        Re: Is there a simpler way to modify all arguments in a function before using the arguments? Chris Angelico <rosuav@gmail.com> - 2012-11-10 20:19 +1100
  Re: Is there a simpler way to modify all arguments in a function before using the arguments? Miki Tebeka <miki.tebeka@gmail.com> - 2012-11-09 20:17 -0800
    Re: Is there a simpler way to modify all arguments in a function before using the arguments? Peter Otten <__peter__@web.de> - 2012-11-10 10:09 +0100
      Re: Is there a simpler way to modify all arguments in a function before using the arguments? aahz@pythoncraft.com (Aahz) - 2012-11-10 07:35 -0800
        Re: Is there a simpler way to modify all arguments in a function before using the arguments? bruceg113355@gmail.com - 2012-11-10 09:56 -0800
        Re: Is there a simpler way to modify all arguments in a function before using the arguments? Peter Otten <__peter__@web.de> - 2012-11-11 10:28 +0100
        Re: Is there a simpler way to modify all arguments in a function before using the arguments? brucegoodstein@gmail.com - 2012-11-15 15:20 -0800
          Re: Is there a simpler way to modify all arguments in a function before using the arguments? Emile van Sebille <emile@fenx.com> - 2012-11-15 16:03 -0800
          Re: Is there a simpler way to modify all arguments in a function before using the arguments? Ethan Furman <ethan@stoneleaf.us> - 2012-11-15 20:00 -0800
            Re: Is there a simpler way to modify all arguments in a function before using the arguments? bruceg113355@gmail.com - 2012-11-16 07:00 -0800
              Re: Is there a simpler way to modify all arguments in a function before using the arguments? Ethan Furman <ethan@stoneleaf.us> - 2012-11-16 13:30 -0800
            Re: Is there a simpler way to modify all arguments in a function before using the arguments? bruceg113355@gmail.com - 2012-11-16 07:00 -0800
  Re: Is there a simpler way to modify all arguments in a function before using the arguments? Steve Howell <showell30@yahoo.com> - 2012-11-11 09:45 -0800

csiph-web