Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93025

Re: Simplest/Idiomatic way to count files in a directory (using pathlib)

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Simplest/Idiomatic way to count files in a directory (using pathlib)
Date 2015-06-22 18:32 -0700
Organization A noiseless patient Spider
Message-ID <87k2uvjjjv.fsf@nightsong.com> (permalink)
References <mailman.712.1435012328.13271.python-list@python.org>

Show all headers | View raw


Travis Griggs <travisgriggs@gmail.com> writes:
> The following seems to obtuse/clever for its own good:
>     return sum(1 for _ in self.path.iterdir())

I've generally done something like that.  I suppose it could be added to
itertools.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Simplest/Idiomatic way to count files in a directory (using pathlib) Travis Griggs <travisgriggs@gmail.com> - 2015-06-22 15:31 -0700
  Re: Simplest/Idiomatic way to count files in a directory (using pathlib) Paul Rubin <no.email@nospam.invalid> - 2015-06-22 18:32 -0700
    Re: Simplest/Idiomatic way to count files in a directory (using pathlib) Terry Reedy <tjreedy@udel.edu> - 2015-06-23 12:17 -0400

csiph-web