[issue22619] Possible implementation of negative limit for traceback functions

2015-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Dmitry.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-05-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eb6052605fd8 by Serhiy Storchaka in branch 'default':
Issue #22619: Added negative limit support in the traceback module.
https://hg.python.org/cpython/rev/eb6052605fd8

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-26 Thread Robert Collins

Robert Collins added the comment:

Nice, looks pretty elegant to me. I have nothing to add to the prior reviewers 
comments.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-22 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file39166/traceback_limit_doc_rev3.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

As francismb noted, there are too long lines in the patch. They should be 
wrapped.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-21 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Thanks, completely missed the abs(limit) part. Here's the updated documentation 
patch.

--
Added file: http://bugs.python.org/file39161/traceback_limit_doc_rev.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-21 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file39162/traceback_limit_doc_rev2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-21 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file39161/traceback_limit_doc_rev.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-20 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Here's the documentation patch.

--
Added file: http://bugs.python.org/file39152/traceback_limit_doc.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-19 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I'll do that tomorrow. The patch still needs a review though...

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed a documentation. I'm not interested in writing it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-19 Thread Riley Banks

Changes by Riley Banks waul...@gmail.com:


--
nosy: +vaultah

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-03-21 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Again, I'm honestly sorry if I'm being annoying, but is there anything else 
that needs to be done in order to make this issue resolved? The stage is set 
to patch review, although there were no messages posted since the latest 
patch was submitted and there're no comments to the Patch set 6 in Rietveld.

 If your patch has not received any notice from reviewers (i.e., no comment 
 made) after one month, first “ping” the issue on the issue tracker to remind 
 the nosy list that the patch needs a review. 

Is this true for the patch review stage? I pinged this issue about a month 
ago, but haven't got any response; should I have emailed python-...@python.org 
even if the patch is not mine?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-03-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Due to changes in issue17911 the patch no longer applied cleanly an should be 
rewritten. But changes in issue17911 are close to my patch. 
_tb_frame_lineno_iter matches walk_tb and _stack_frame_lineno_iter matches 
walk_stack. So new patch is simpler.

--
nosy: +rbcollins
Added file: http://bugs.python.org/file38622/traceback_negative_limit_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-03-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I proposed changed patch. It needs a review.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your patches Dmitry.

But I think that the code can be made simpler. Here is a patch which refactors 
extracting code. It splits the code on few generators which do different tasks: 
iterate over tracebacks or frames linked list, limit the size of proceeded 
sequence, and generates required fields. Note that the behavior of 
extract_stack() with negative limit differs if sys.tracebacklimit is specified 
and less than the length of full traceback. Tests are changed too, now they 
test all combinations of the limit parameter and sys.tracebacklimit.

--
stage:  - patch review
Added file: http://bugs.python.org/file37731/traceback_negative_limit_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Thank you, Terry. You got the proposal right. I'm glad you noticed the issues 
with tests, I updated the patch to fix them.

--
Added file: http://bugs.python.org/file37628/traceback_rev2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file37181/traceback.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file37341/traceback_patch_2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file36919/tb_patch_2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I improved tests for *_stack and *_tb functions, fixed a few typos and added 
more comments.

--
Added file: http://bugs.python.org/file37632/traceback_rev3.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-07 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Hold on, I found 2 more bugs. Will update the patch soon.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-06 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Some of the patches (including the latest one) were missing Mercurial header. 
I'm uploading the properly formatted patch (traceback_rev_fixed.diff)

--
Added file: http://bugs.python.org/file37615/traceback_rev_fixed.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For future reference, a better initial post would have been more self-contained 
and explanatory, something like the following.  (If I got the proposal wrong, 
all the more reason to explain it clearly).
---
Several functions in the traceback module take a *limit* argument to limit 
output to the first n 'stack trace entries'.  This issue proposes that negative 
limits should instead limit output to the last n entries. This idea was 
discussed on python ideas and approved by Guido there.
https://mail.python.org/pipermail/python-ideas/2014-October/029826.html.
---

Do the new tests pass with n=0?  If not, do the functions have a sensible 
behavior (print header and no entries, rather than raising) that could be 
tested?

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
assignee:  - serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-05 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I understand that this issue is far from being important, but this is going to 
be the fourth unreviewed file in this issue. I noted all your comments to me 
and fixed the patch accordingly, but ever since November I'm the only one who 
posts something here. I pinged the issue about 4 days ago (after a month of 
utter silence) and still didn't get any response. Could someone review the 
latest patch (the one I attach to this message - traceback_rev.diff) or at 
least say what's wrong with it (or with this issue, or with something else)?

--
Added file: http://bugs.python.org/file37600/traceback_rev.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2015-01-01 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Python Developer's Guide said to ping the issue, in case of one-month long 
inactivity period.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-12-01 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-12-01 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Moved the latest patch with implementation and tests from issue 22974 
(http://bugs.python.org/issue22974).

--
status: closed - open
Added file: http://bugs.python.org/file37341/traceback_patch_2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-11-30 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Revisiting this issue, I realize that I made quite a few mistakes (because this 
was the first issue I submitted). The patch is definitely minor, and I'm no 
longer interested in it. This issue may now be closed. Cheers.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-11-30 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-11-30 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
status: closed - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-11-11 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I updated the patch.

--
Added file: http://bugs.python.org/file37181/traceback.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-11-04 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I'm not sure what would be the best way to support negative limit for stack 
functions. Actually, I think the current behavior is not intuitive. For example 
we could make positive limit mean the same thing for traceback and stack 
functions (load N entries, starting from the caller), but in that case the 
change will inverse the behavior of code that uses stack functions. Since the 
traceback module is mostly used for printing/formatting the difference won't be 
crucial.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-23 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I think the reason this patch hasn't been discussed well is that it only 
changes the behavior for traceback.*_tb functions that only deal with 
tracebacks. I commented on the review page that we don't have to change the 
behavior of traceback.*_stack functions to make it obvious. Let me show an 
example:

import sys

def a():
b()

def b():
c()

def c():
d()

def d():
def e():
print_stack(limit=2) # Last 2 entries
''' Output:
File file, line 331, in d 

  
  e()   

  
File file, line 328, in e
  print_stack(limit=2) # Last 2 entries '''
raise Exception
e()

try:
a()
except Exception:
print_exc(limit=2) # 2 entries from the caller
''' Output:
Traceback (most recent call last):
  File file, line 336, in module
a()
  File file, line 318, in a
b()
Exception '''

If we decide to unify the behavior of *_tb and *_stack functions, the change 
will break some existing code, although the breakage will be purely cosmetic.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

More likely the lack of discussion is just that Serhiy is busy :)

Breaking code is to be avoided if possible.  Can you give an example of the 
cosmetic change?

I haven't fully reviewed the patch, but a more meaningful name than 'condition' 
might make the code more readable.  Perhaps 'handling_negative_limit'?

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Last patch is more complicated and needs more time to review.

I suppose the code would be more clear if split _extract_tb_or_stack_iter() to 
parts. One generator just generates (filename, lineno, name, f.f_globals) 
tuples. Then these tuples either handled directly or passed through a deque 
with fixed size.

And some tests would be good.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Renamed the cond variable, added tuple unpacking instead of using a single 
variable.

--
Added file: http://bugs.python.org/file36916/tb_patch.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file36916/tb_patch.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
hgrepos: +278

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file36918/4a0ec19e4288.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
hgrepos:  -278

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Removed file: http://bugs.python.org/file36918/4a0ec19e4288.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-14 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file36919/tb_patch_2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Here's the updated (optimized) patch

--
hgrepos: +277

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file36899/9cb7aaad1d85.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
hgrepos:  -277

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
hgrepos:  -275

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Dmitry Kazakov

New submission from Dmitry Kazakov:

This is the possible patch for this proposal: 
https://mail.python.org/pipermail/python-ideas/2014-October/029826.html.

--
components: Library (Lib)
messages: 229167
nosy: vlth
priority: normal
severity: normal
status: open
title: Possible implementation of negative limit for traceback functions
type: enhancement
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

def _extract_tb_or_stack_iter(curr, limit, extractor):
# Distinguish frames from tracebacks (need to import types)
if limit is None:
limit = getattr(sys, 'tracebacklimit', None)
elif limit  0 and isinstance(curr, types.TracebackType):
seq = list(_extract_tb_or_stack_iter(curr, None, extractor))
yield from seq[limit:]
else:
pass

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You forgot a patch.

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Sorry, first time posting here; accidently pressed Enter.

--
hgrepos: +275

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file36891/9f618a0c2880.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I have added comments on Retvield (a system for patch reviewing). You should 
receive an email about this.

In general the patch is not optimal. There is no need to load source lines for 
dropped entries.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-12 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Thanks. I replied to your comments at Retvield. I'll update the patch tomorrow.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22619
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com