Order in metaclass

Carlos Ribeiro carribeiro at gmail.com
Wed Oct 13 17:46:04 EDT 2004


On Wed, 13 Oct 2004 21:32:20 +0200, Thomas Heller <theller at python.net> wrote:
> And for your original question: why do you insist on your new syntax,
> why don't you simply (as ctypes also does it) define the attributes in a
> list, when they have to have a certain order?

It's funny, but I was working with a good case for native (as in
source-code-defined) ordering right now and had missed it. I'm
learning to write test cases using unittest.py, and it just stroke me
that it's better to have tests to run in the order of complexity, in a
predictable way; it makes reading the list and analyzing the results
easier. My tests are beginning to get complex, and I just thought that
this would be a good use of our techniques (specially because defs
already have ordering information stored as function code attributes).

(in fact, I just checked unittest.py; it seems to be relatively easy
to change, because it has a hook for a cmp function that can use this
extra information)

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list