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


Groups > comp.lang.python > #75132

Re: one to many (passing variables)

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 <shieldfire@gmail.com>
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&gt;': 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 <CAPTjJmr8nQfhM7JRBJGc=hew4H8kKjkD2xU71H67HaDVcP6W=g@mail.gmail.com>
References <CAHXoDSB+-Vkggfd57nb9eLSK7Pb_fbuycGTJZM=+6=4VZo3F0w@mail.gmail.com> <CAPTjJmr8nQfhM7JRBJGc=hew4H8kKjkD2xU71H67HaDVcP6W=g@mail.gmail.com>
MIME-Version 1.0
Content-Type multipart/alternative; boundary="----I39J5LO2VLW3IT2GN14L2P3YV46L3L"
Content-Transfer-Encoding 8bit
Subject Re: one to many (passing variables)
From Martin S <shieldfire@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12271.1406186922.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

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.

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


Thread

Re: one to many (passing variables) Martin S <shieldfire@gmail.com> - 2014-07-24 09:27 +0200
  Re: one to many (passing variables) Steven D'Aprano <steve@pearwood.info> - 2014-07-24 09:15 +0000

csiph-web