Stefan Krah <stefan-use...@bytereef.org> added the comment:

I like random tests in the stdlib, otherwise the same thing gets tested
over and over again. `make buildbottest` prints the seed, and you can do
it for a single test as well:

 $ ./python -m test -r test_heapq
Using random seed 5857004
[1/1] test_heapq
1 test OK.


It looks like the choice is between s.nmembers and len(s). I thought
about len(s), but since Struct.pack() returns a bytes object, this
might be confusing.

Struct.arity may be another option. This also reflects that pack()
will be an n-ary function for the given format string (and that
Struct is a packing object, not really a struct itself).


Still, probably I'm +0.5 on 'nmembers' compared to the other options.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12740>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to