Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18518
___
Roundup Robot added the comment:
New changeset e8db1cbe416b by Serhiy Storchaka in branch '2.7':
Issue #18518: timeit now rejects statements which can't be compiled outside
https://hg.python.org/cpython/rev/e8db1cbe416b
New changeset a5769fa55791 by Serhiy Storchaka in branch '3.4':
Issue
STINNER Victor added the comment:
Buildbots are unhappy. Example:
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.0%202.7/builds/837/steps/test/logs/stdio
1 test failed:
test_timeit
Re-running test 'test_timeit' in verbose mode
test test_timeit crashed -- type
Serhiy Storchaka added the comment:
Already fixed in 617c226da195. Needs time for buildbots to rerun tests. I
didn't noticed error when backported tests because there was local file
support.py in my workspace.
--
___
Python tracker
Serhiy Storchaka added the comment:
If there are no objections I'm going to commit the patch.
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18518
___
Changes by A.M. Kuchling a...@amk.ca:
--
nosy: -akuchling
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18518
___
___
Python-bugs-list mailing
Serhiy Storchaka added the comment:
May be add a guard against statements which can confuse timeit? These are not
only return, but yield, and break and continue outside of a loop.
Proposed patch checks that testing code can be compiled outside of a function.
--
assignee: docs@python -
jonathan ferretti added the comment:
Added note to timeit function briefly explaining how to avoid it the issue and
the cause
--
keywords: +patch
nosy: +jonathan.ferretti
type: enhancement - behavior
Added file: http://bugs.python.org/file34823/timeit.patch
Roundup Robot added the comment:
New changeset 7e2708484ea5 by Andrew Kuchling in branch '3.4':
#18518: mention that including a return statement changes/breaks the behaviour
http://hg.python.org/cpython/rev/7e2708484ea5
--
nosy: +python-dev
___
R. David Murray added the comment:
The suggestion was to make this a footnote, not a note. Also, it should
probably say that the stmt is executed inside a function, meaning that instead
of being a syntax error it changes the return value of the internal timeit
function.
I understand
A.M. Kuchling added the comment:
BTW, this change is also relevant to 2.7. Previously I wouldn't have bothered
to commit it to 2.7 since the branch was largely closed, but now we're talking
about some corporate maintainer eventually going through and backporting fixes
to the newly-extended
A.M. Kuchling added the comment:
I dislike footnotes and prefer to put things in the text whenever possible.
The text for this change struck as relevant enough -- it notes a property of
the *stmt* parameter -- that it doesn't belong in a footnote. (I'd be happy to
just make it a paragraph
R. David Murray added the comment:
OK, if you think it is worthwhile in the text, then sure. But yeah, not as a
..note. And yes, I think we should keep backporting relevant doc patches.
Especially since Google results still land one on the 2.7 docs...
--
Changes by Ramchandra Apte maniandra...@gmail.com:
--
title: return-ing within timeit.timeit causes wrong return value of
timeit.timeit - return-ing within code timed with timeit.timeit causes wrong
return value of timeit.timeit
___
Python tracker
R. David Murray added the comment:
I'm inclined to agree with Ramchandra. It might be worth a doc footnote,
though.
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18518
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
type: behavior - enhancement
versions: +Python 2.7, Python 3.4
___
Python tracker rep...@bugs.python.org
Raymond Hettinger added the comment:
Agreed this should be closed as won't fix.
--
nosy: +rhettinger
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18518
R. David Murray added the comment:
Rather than closing it, we converted it to a documentation issue. I think it
is worth a footnote in the docs, since it is not obvious (without reading the
source code) that a return statement will cause timeit to return an invalid
result instead of raising
Raymond Hettinger added the comment:
Go ahead and add a footnote, but do consider that such footnotes are mostly
just clutter. It doesn't help someone at the moment there is an invalid return
value -- instead it just makes it so that afterward someone can say that it is
documented.
19 matches
Mail list logo