using "private" parameters as static storage?

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Nov 13 21:35:02 EST 2008


Joe Strout <joe at strout.net> writes:

> On Nov 13, 2008, at 10:19 AM, Chris Mellon wrote:
> 
> > Static storage is a way of preserving state. Objects are a way of
> > encapsulating state and behavior. Use an object.
> 
> Argh. I've been back in the Python community for about a month, and
> I've been continually amazed at how every single "how do I do X" or
> "what do you think of this method of doing X" question is answered
> by people on high horses claiming "you shouldn't do X".

You seem to be reading the responses differently from me. I don't see
that the above response fits the pattern you describe at all.

Instead, it looks like you're falling foul of one of the classic
mistakes in the “How to ask questions the smart way” document:
you've got a goal, but you're assuming that you need to use a specific
tool to get there. Instead, you're being shown that your assumption is
false: there's a better tool available to achieve your goal.

-- 
 \           “Why, I'd horse-whip you if I had a horse.” —Groucho Marx |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list