Re: on the popularity of loops while and for

2021-09-04 Thread Hope Rouselle
"Peter J. Holzer" writes: > On 2021-08-29 10:04:47 +0100, Barry wrote: >> > I'd like get a statistic of how often each loop is used in practice. >> > >> > I was trying to take a look at the Python's standard libraries --- those >> > included in a standard installation of Python 3.9.6, say ---

Re: on the popularity of loops while and for

2021-09-04 Thread Peter J. Holzer
On 2021-08-29 10:04:47 +0100, Barry wrote: > > I'd like get a statistic of how often each loop is used in practice. > > > > I was trying to take a look at the Python's standard libraries --- those > > included in a standard installation of Python 3.9.6, say --- to see > > which loops are more of

Re: on the popularity of loops while and for

2021-09-02 Thread Hope Rouselle
Terry Reedy writes: > On 8/28/2021 9:31 AM, Hope Rouselle wrote: >> I'd like get a statistic of how often each loop is used in practice. > > My guess is that for loops are at least twice as common as while loops. Scanning just the Python 3.9.6's Lib/ directory --- using the ast module and the pr

Re: on the popularity of loops while and for

2021-09-02 Thread Hope Rouselle
Chris Angelico writes: > On Sun, Aug 29, 2021 at 7:40 AM Hope Rouselle wrote: >> >> I'd like get a statistic of how often each loop is used in practice. >> >> I was trying to take a look at the Python's standard libraries --- those >> included in a standard installation of Python 3.9.6, say ---

Re: on the popularity of loops while and for

2021-09-02 Thread Hope Rouselle
Barry writes: >> On 28 Aug 2021, at 22:42, Hope Rouselle wrote: >> >> I'd like get a statistic of how often each loop is used in practice. >> >> I was trying to take a look at the Python's standard libraries --- those >> included in a standard installation of Python 3.9.6, say --- to see >>

Re: on the popularity of loops while and for

2021-08-29 Thread Barry
 > On 28 Aug 2021, at 22:42, Hope Rouselle wrote: > > I'd like get a statistic of how often each loop is used in practice. > > I was trying to take a look at the Python's standard libraries --- those > included in a standard installation of Python 3.9.6, say --- to see > which loops are mor

Re: on the popularity of loops while and for

2021-08-28 Thread Stestagg
On Sun, 29 Aug 2021 at 00:04, Stefan Ram wrote: > Stestagg writes: > >If you're doing this analysis, I'd be pretty interested in how many of > >those while loops where 'while True:' > > Here, about 40 %. Thanks! That's an interesting stat. I might have to look more into how while loops ar

Re: on the popularity of loops while and for

2021-08-28 Thread Terry Reedy
On 8/28/2021 9:31 AM, Hope Rouselle wrote: I'd like get a statistic of how often each loop is used in practice. My guess is that for loops are at least twice as common as while loops. I was trying to take a look at the Python's standard libraries --- those included in a standard installation

Re: on the popularity of loops while and for

2021-08-28 Thread Stestagg
If you're doing this analysis, I'd be pretty interested in how many of those while loops where 'while True:' I'd wager 75%. But may be completely off Steve On Sat, 28 Aug 2021 at 23:03, Hope Rouselle wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > > > Hope Rouselle writes: > >>Have y

Re: on the popularity of loops while and for

2021-08-28 Thread Hope Rouselle
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Hope Rouselle writes: >>Have you guys ever measured something like that in a casual or serious > > import ast > import pathlib > rootname=r'' > rootpath=pathlib.Path(rootname) > rootiterable=rootpath.glob('**/*.py') > first = True > WhileCount =

Re: on the popularity of loops while and for

2021-08-28 Thread Chris Angelico
On Sun, Aug 29, 2021 at 7:40 AM Hope Rouselle wrote: > > I'd like get a statistic of how often each loop is used in practice. > > I was trying to take a look at the Python's standard libraries --- those > included in a standard installation of Python 3.9.6, say --- to see > which loops are more of

on the popularity of loops while and for

2021-08-28 Thread Hope Rouselle
I'd like get a statistic of how often each loop is used in practice. I was trying to take a look at the Python's standard libraries --- those included in a standard installation of Python 3.9.6, say --- to see which loops are more often used among while and for loops. Of course, since English u