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: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'modify': 0.05; 'that?': 0.05; 'arguments': 0.07; 'newline': 0.07; 'other,': 0.09; 'separately': 0.09; 'subject:using': 0.09; 'def': 0.10; 'encoding': 0.15; '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; 'instance,': 0.17; 'appropriate': 0.20; 'translate': 0.20; 'body,': 0.22; 'simpler': 0.22; 'paul': 0.24; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'escaped': 0.29; 'writes:': 0.29; 'subject:all': 0.29; 'function': 0.30; 'to:addr:python-list': 0.33; 'that,': 0.34; 'received:google.com': 0.34; 'nov': 0.35; 'pm,': 0.35; 'subject:?': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'there': 0.35; 'characters': 0.36; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'email addr:gmail.com': 0.63; 'to,': 0.65; 'subject:there': 0.65; 'subject': 0.66; 'special': 0.73; '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=9Xz8GelBnKcisWMhwtsOJuZ3NjtmWDN4WwheeUTYtBs=; b=pevQAaek1pS/sXh0Vuzq2a9wJUW8Gn0ubiJ5wmIK8cnMwtNP+qBK1Z3RsTLUZgNtf7 lWjPF7C81HNVJ+ytOZxtQrHLvfoNDiJoawk3h2ceqAYlZ2xRYXWXh7qUGFZ9GDcIaDYA oWn8AP+Did0sqAHkqctsM7Dr7y5UYJvd40YkbXx1QGP8qdtj01GkfpxqSfRi6IdhdoK3 kfjuZERxxq8ROO/4xnVdeDdl8Saq8uFMGybf9dFl6JCpkynKx1MrfRVgcuE8M0rmZy2e MP3ABRr8EhvSkrd2KUiCjFset7THeqqLxkQO0VXdGaEqfrNsHnduqfsfI0BvcQ9DUuXN 20sQ== MIME-Version: 1.0 In-Reply-To: <7xlieadv9o.fsf@ruckus.brouhaha.com> References: <18134e77-9b02-4aec-afb0-794ed900d194@googlegroups.com> <7xlieadv9o.fsf@ruckus.brouhaha.com> Date: Sat, 10 Nov 2012 14:56:40 +1100 Subject: Re: Is there a simpler way to modify all arguments in a function before using the arguments? From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352519803 news.xs4all.nl 6863 [2001:888:2000:d::a6]:49526 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33072 On Sat, Nov 10, 2012 at 1:52 PM, Paul Rubin wrote: > bruceg113355@gmail.com writes: >> Is there a simpler way to modify all arguments in a function before >> using the arguments? > > Why do you want to do that? > Contrived example: def send_email(from, to, subj, body, whatever, other, headers, you, like): # Okay, now translate all those into the appropriate encoding and with special characters escaped # We need to translate each one separately so that, for instance, a newline in the subject won't let you create additional headers ChrisA