preferring [] or () in list of error codes?

Ben Finney ben+python at
Tue Jun 9 03:02:54 CEST 2009

Carl Banks <pavlovevidence at> writes:

> If you want to go strictly by the book, I would say he ought to be
> using a set since his collection of numbers has no meaningful order
> nor does it make sense to list any item twice.

Yes, a set would be best for this specific situation.

> I don't think it's very important, however, to stick to rules like
> that for objects that don't live for more than a single line of code.

It's important to the extent that it's important to express one's
*meaning*. Program code should be written primarily as a means of
communicating with other programmers, and only incidentally for the
computer to execute.

 \        “Laurie got offended that I used the word ‘puke’. But to me, |
  `\                 that's what her dinner tasted like.” —Jack Handey |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list