[Tutor] Opinion - help could use more examples

Jim Mooney cybervigilante at gmail.com
Wed Jun 19 19:43:06 CEST 2013


Here's a peeve of mine about Python help - it often has zero examples.
I printed help(zip) to see what it does and got this:

  Return a zip object whose .__next__() method returns a tuple where
 |  the i-th element comes from the i-th iterable argument.  The .__next__()
 |  method continues until the shortest iterable in the argument sequence
 |  is exhausted and then it raises StopIteration.

Not understandable right off, IMHO, unless you're already hardcore.
Okay, I figured it out by running it with some iterables, so I didn't
have to google around looking for examples. It would have saved time
if there was just one example of what you would get from running
next() on a zip or number lists a few times, since it's a simple
concept. I'm coming from Jquery, which is chock full of examples, so
everyone from bankers to pimps (if there is a difference) can use it.
I think the name is confusing zip with compacting, too.

Although to be fair.
choosing_nth_item_from_parallel_sequences_until_there_is_no_match_on_n()
might be too much typing compared to zip() ;')

-- 
Jim
Sci-fi novel in one line:
Congratulations miss, you have twins - but one is dark matter.


More information about the Tutor mailing list