On 11 June 2017 at 13:35, Neal Fultz <nfu...@gmail.com> wrote:
> Whoops, scratch that part about encode /decode.

Aye, decode is a relatively straightforward nested comprehension:

    def run_length_decode(iterable):
        return (item for item, item_count in iterable for __ in
range(item_count))

It's only encode that is currently missing a clear self-evidently
correct spelling, and I think that's more due to the lack of an
obvious spelling for "tell me how many items are in this iterable,
exhausting it if necessary" than it is to anything else.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to