Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'arguments,': 0.09; 'subject:using': 0.09; 'def': 0.10; 'passing': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "steve's": 0.16; 'subject: \n ': 0.16; 'tuple,': 0.16; 'wrote:': 0.17; 'received:209.85.214.174': 0.21; 'example': 0.23; 'header :In-Reply-To:1': 0.25; 'am,': 0.27; 'coding': 0.27; 'separate': 0.27; 'message-id:@mail.gmail.com': 0.27; 'all.': 0.28; 'subject:all': 0.29; 'week.': 0.30; '11,': 0.33; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'nov': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'next': 0.35; 'list.': 0.35; 'but': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'build': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'taking': 0.65; 'subject:there': 0.65; 'routines': 0.84; 'subject:before': 0.84; 'technically': 0.91 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=OS/mjGGlzagHgoCjxFb5QU1RO9noucJYd0llSKjzofo=; b=bPza36Y0LnI90XhNyQEAxG19t+95+r2KnZhpOF1H0ok3uS03j4hIWm6F1hHvdiIn8r tozVTxo1r96x45T3Nt3xCGRehXmIe8nrHe11iJewi4/zYQ8/lai1lxLLSXGjpYYO+pac WBgve/F7uYQVlg5lUFTCyAtsd23jS3LOCYIy1jrYFRpnW6dhGiJUupliRGPsAknJ5kd1 tlChvJYBICpUKKYao0GZrWtVGH4TZXvNG0zCHz5n8wdj8hKFhJZVStOghtjHBxzOxR9X fAOX/mtT6e1S8HNh99C14ED90KQSbrZJYtc/N3YDUOXQY3RsQDzqhZUXo2ElL+fTDhns E+8A== MIME-Version: 1.0 In-Reply-To: <8e17124b-63ee-4166-8964-80f47f5716d5@googlegroups.com> References: <18134e77-9b02-4aec-afb0-794ed900d194@googlegroups.com> <509daadc$0$29980$c3e8da3$5496439d@news.astraweb.com> <8e17124b-63ee-4166-8964-80f47f5716d5@googlegroups.com> Date: Sun, 11 Nov 2012 05:33:58 +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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352572887 news.xs4all.nl 6890 [2001:888:2000:d::a6]:49046 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33096 On Sun, Nov 11, 2012 at 12:15 AM, wrote: > Thanks to all. > Steve's example is the one I will try next week. > Passing in lists, will work but it requires extra coding from the calling routines to build the list. Not necessarily! Watch: def foo(*args): print(repr(args)) foo("Hello","world","!") ('Hello', 'world', '!') Okay, that's not technically a list, it's a tuple, but same diff. Your callers still see you as taking separate arguments, but you take them as a single collection. ChrisA