Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33471 > unrolled thread
| Started by | rh <richard_hubbe11@lavabit.com> |
|---|---|
| First post | 2012-11-17 09:25 -0800 |
| Last post | 2012-11-17 13:30 -0800 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.python
module trace and counts rh <richard_hubbe11@lavabit.com> - 2012-11-17 09:25 -0800
Re: module trace and counts Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-17 17:47 +0000
Re: module trace and counts rh <richard_hubbe11@lavabit.com> - 2012-11-17 13:30 -0800
| From | rh <richard_hubbe11@lavabit.com> |
|---|---|
| Date | 2012-11-17 09:25 -0800 |
| Subject | module trace and counts |
| Message-ID | <mailman.3772.1353173085.27098.python-list@python.org> |
Is it for or range that is executed 8000 times when I for i in range(3,8000,2): Maybe the for and the range contributes to that total. Can anyone recommend their favorite trace or profile type tool that spits out an html page? I like trace because I don't have to insert my program into it but would like a html page too.
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2012-11-17 17:47 +0000 |
| Message-ID | <50a7cdce$0$29978$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #33471 |
On Sat, 17 Nov 2012 09:25:02 -0800, rh wrote:
> Is it for or range that is executed 8000 times when I for i in
> range(3,8000,2):
I'm sorry, I don't understand that question.
Is it for what? What "it" are you talking about?
If you run the code:
for i in range(3, 8000, 2):
pass
the `for` statement executes once, giving 3999 iterations in total.
`range` gets executed once. Nothing is executed 8000 times.
> Maybe the for and the range contributes to that total.
What total?
I'm sure the context of your question is obvious to you, but we're not
mind-readers and have no idea what you have done and what total you have
got. Please explain your question.
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | rh <richard_hubbe11@lavabit.com> |
|---|---|
| Date | 2012-11-17 13:30 -0800 |
| Message-ID | <mailman.3781.1353187781.27098.python-list@python.org> |
| In reply to | #33472 |
On 17 Nov 2012 17:47:58 GMT Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Sat, 17 Nov 2012 09:25:02 -0800, rh wrote: > > > Is it for or range that is executed 8000 times when I for i in > > range(3,8000,2): > > I'm sorry, I don't understand that question. > > Is it for what? What "it" are you talking about? > > If you run the code: > > for i in range(3, 8000, 2): > pass > > the `for` statement executes once, giving 3999 iterations in total. > `range` gets executed once. Nothing is executed 8000 times. I provided further info in another reply on this same thread. But for sake of clarity and correctness here is what module trace shows for a single pass: 4000: for i in range(3,8000,2): 3999: pass
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web