Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'tutorial': 0.03; 'nested': 0.07; 'cc:addr:python-list': 0.11; 'martin': 0.11; '24,': 0.16; '>on': 0.16; 'at.': 0.16; 'code?': 0.16; 'collects': 0.16; 'module?': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'email addr:gmail.com>': 0.22; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'logical': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'them?': 0.31; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'subject:one': 0.36; 'should': 0.36; 'message-id:@gmail.com': 0.38; 'pm,': 0.38; 'little': 0.38; 'bad': 0.39; 'itself': 0.39; 'how': 0.40; 'ensure': 0.60; 'solve': 0.60; 'mentioned': 0.61; 'son': 0.61; 'between': 0.67; 'jul': 0.74; '2014,': 0.84; 'url:apps': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:in-reply-to:references:mime-version:content-type :content-transfer-encoding:subject:from:date:cc:message-id; bh=quQl1qdQN0lAS5abqx7ijsQAKFW3mab/3L18TmKJD7s=; b=xifLMrrCMHedQGV74QCU6Y5BW1U82ToE4s5zqcGtV/fKkrl4p2flTA5Y6X8sv6SMfU RvT5AN7SszFSI/4TM2mg61l2xef0vUpIToUuVK1HSgs5LBig8NYdv3jujp1WlFiz2Duo LekkMJA8YumnbZHh+7FGDES31mvgE//v2HMb+yAZtgh/TpH4GNwtVxhowHQuGdGekHuP UwLb3eZYqGu5bHCKcd2gao6inhHMy4Kba/KgmC+r7F775a+QDBsGyxZf2KnqwAHxs8sz mB1uXpHALjNyWFa9sFqtp8ExpzE9NJl6voQ0d1YbrP/ExtslP51fLk29eyQkibFcFE3C D9zw== X-Received: by 10.152.8.166 with SMTP id s6mr7110480laa.85.1406186914842; Thu, 24 Jul 2014 00:28:34 -0700 (PDT) User-Agent: K-@ Mail for Android X-Priority: 3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----I39J5LO2VLW3IT2GN14L2P3YV46L3L" Content-Transfer-Encoding: 8bit Subject: Re: one to many (passing variables) From: Martin S Date: Thu, 24 Jul 2014 09:27:10 +0200 CC: python-list@python.org 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406186922 news.xs4all.nl 2836 [2001:888:2000:d::a6]:42408 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75132 ------I39J5LO2VLW3IT2GN14L2P3YV46L3L Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Function A collects data and then calls function B with some, but also has data that should be passed to function C. But ofc if nested functions are allowed then that might solve the issue. I don't think I've seen nested functions mentioned in a tutorial I've been looking at. /martin s On 24 Jul 2014, Chris Angelico wrote: >On Thu, Jul 24, 2014 at 4:36 PM, Martin S wrote: >> How do you pass data from one function to many? >> >> I have functions A B and C. If data generated in A is useable in both >> B and C how do I ensure this data is passed as needed? Or is it a >> symptom of bad code? > >This is a little vague. Is there one function which calls A and then >calls B and C? What's the relationship between them? Is it logical for >A to itself call B and C? Are they all methods off one object? >Top-level functions in a module? > >ChrisA -- Sent with K-@ Mail - the evolution of emailing. ------I39J5LO2VLW3IT2GN14L2P3YV46L3L Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Function A collects data and then calls function B with some, but also has data that should be passed to function C.

But ofc if nested functions are allowed then that might solve the issue. I don't think I've seen nested functions mentioned in a tutorial I've been looking at.

/martin s

On 24 Jul 2014, Chris Angelico <rosuav@gmail.com> wrote:
On Thu, Jul 24, 2014 at 4:36 PM, Martin S <shieldfire@gmail.com> wrote:
How do you pass data from one function to many?

I have functions A B and C. If data generated in A is useable in both
B and C how do I ensure this data is passed as needed? Or is it a
symptom of bad code?

This is a little vague. Is there one function which calls A and then
calls B and C? What's the relationship between them? Is it logical for
A to itself call B and C? Are they all methods off one object?
Top-level functions in a module?

ChrisA

-- Sent with K-@ Mail - the evolution of emailing. ------I39J5LO2VLW3IT2GN14L2P3YV46L3L--