Message142073
| Author |
skrah |
| Recipients |
georg.brandl, mark.dickinson, meador.inge, pitrou, r.david.murray, rhettinger, skrah |
| Date |
2011年08月14日.18:03:55 |
| SpamBayes Score |
8.154412e-07 |
| Marked as misclassified |
No |
| Message-id |
<1313345036.11.0.789905045333.issue12740@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|