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


Groups > comp.lang.python > #75135 > unrolled thread

Re: one to many (passing variables)

Started byBen Finney <ben+python@benfinney.id.au>
First post2014-07-24 19:58 +1000
Last post2014-07-24 19:58 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: one to many (passing variables) Ben Finney <ben+python@benfinney.id.au> - 2014-07-24 19:58 +1000

#75135 — Re: one to many (passing variables)

FromBen Finney <ben+python@benfinney.id.au>
Date2014-07-24 19:58 +1000
SubjectRe: one to many (passing variables)
Message-ID<mailman.12273.1406195935.18130.python-list@python.org>
Martin S <shieldfire@gmail.com> writes:

> 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 very vague; an accurate answer is “it depends”.

You seem to be asking about how to design your data structures and APIs.
This is less a Python-specific question and more a matter of experience
and judgement.

Here is an article on good API design; the principles apply to Python
<URL:http://blog.isnotworking.com/2007/05/api-design-guidelines.html>.
You know your API and its requirements better than we; see whether that
sheds any light on improvements to make.

It sounds like you are needing to decide how to arrange the data
structures. You need to find natural divisions and groupings, such that
you can refer to groupings of properties that make sense and that are
not too unwieldy.

-- 
 \         “Religious faith is the one species of human ignorance that |
  `\     will not admit of even the *possibility* of correction.” —Sam |
_o__)                                 Harris, _The End of Faith_, 2004 |
Ben Finney

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web