Most elegant way to do something N times

Marco Sulla mail.python.org at marco.sulla.e4ward.com
Tue Dec 24 15:41:49 EST 2019


On Tue, 24 Dec 2019 at 01:07, Chris Angelico <rosuav at gmail.com> wrote:
> On Tue, Dec 24, 2019 at 10:45 AM Marco Sulla <...> wrote:
> > ??? Excuse me, but why you needed to call the same function SIX times? This
> > seems to me not elegant in primis.
> >
> > Can you give us a practical example?
>
> File parsing. You read a section header and want to ignore that
> section, so you ignore the next 15 lines.

mmap and find?


On Tue, 24 Dec 2019 at 01:35, DL Neil via Python-list
<python-list at python.org> wrote:
> Taking the top/bottom six from a sorted list of occurrences.

Slicing?


More information about the Python-list mailing list