Good style for multi-valued returns
claird at starbase.neosoft.com
Fri Apr 21 09:48:03 EDT 2000
In article <m3hfcwh6rd.fsf at atrus.jesus.cam.ac.uk>,
Michael Hudson <mwh21 at cam.ac.uk> wrote:
>claird at starbase.neosoft.com (Cameron Laird) writes:
>> Let me guess: folks generally pass tuples for small and
>> determinate-in-number multi-values, and dictionaries other-
>> wise, 'cept some do it all with tuples. Accurate?
>I've always used tuples; I wouldn't have thought of something that
>returns a dictionary as return multiple values.
>Any reason for asking?
"Reason"? You want a *reason*? Well, sure, there
are plenty of those: it's time for me to be more
of a producer than consumer (of methods); I've been
thinking about decomposition; I didn't notice any-
thing in Guido's style guide; I'm eager to learn
Particular thanks to the three people who've already
gently written to remind me that what I really want
in the complex-and-big case is to return an *object*
(but why do you all call it a class? To my ear,
it truly sounds like a confusion to say, "class",
rather than, "instance of a class"). I think I still
have special cases where I want to move dictionaries
around, but I'm learning that their proper domain is
much smaller than I used to believe.
Cameron Laird <claird at NeoSoft.com>
More information about the Python-list