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


Groups > comp.lang.python > #75132

Re: one to many (passing variables)

References <CAHXoDSB+-Vkggfd57nb9eLSK7Pb_fbuycGTJZM=+6=4VZo3F0w@mail.gmail.com> <CAPTjJmr8nQfhM7JRBJGc=hew4H8kKjkD2xU71H67HaDVcP6W=g@mail.gmail.com>
Subject Re: one to many (passing variables)
From Martin S <shieldfire@gmail.com>
Date 2014-07-24 09:27 +0200
Newsgroups comp.lang.python
Message-ID <mailman.12271.1406186922.18130.python-list@python.org> (permalink)

Show all headers | 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