[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-08-19 Thread Robert Collins
Robert Collins added the comment: So I'm still ambivalent at best about this - this interface hasn't been designed for subclassing - I'm sure there is a bunch more stuff that would be needed. What /is/ needed feature wise here is a sideways extension mechanism for doing filtering and transform

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-08-18 Thread Yury Selivanov
Yury Selivanov added the comment: LGTM. FWIW, using 'self.from_exception(..)' is better because this way it's easier to override the method. Another way would be to write 'type(self).from_exception(..)', but I think using 'self' is good enough. -- nosy: +yselivanov _

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Robert Collins
Robert Collins added the comment: I know it 'works', I just think its not appropriate here. -- ___ Python tracker ___ ___ Python-bugs-

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: fixed -> stage: resolved -> patch review status: closed -> open ___ Python tracker ___ _

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: self.from_exception() works as well. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Robert Collins
Robert Collins added the comment: Oh I see, - different things could have been meant but that application will work. But - please don't use self.from_exception: its a class method, so TracebackException.from_exception(...) is the right spelling. -- ___

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file40021/classmethod_2.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file40020/classmethod_2.patch ___ Python tracker ___ ___ Python-bugs-list m

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We can use from_exception() in __init__ because in both cases first three arguments of TracebackException() are type(e), e, e.__traceback__. Without this change changing from_exception() makes less sense. Here is a patch. -- Added file: http://bugs.

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Robert Collins
Changes by Robert Collins : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1be4d7388279 by Robert Collins in branch 'default': Issue #24710: Use cls in TracebackException.from_exception. https://hg.python.org/cpython/rev/1be4d7388279 -- nosy: +python-dev ___ Python tracker

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-25 Thread Robert Collins
Robert Collins added the comment: We can't use from_exception in __init__ because from_exception's job is to look up __traceback__, but the legacy API allows arbitrary tb objects which may not be exc.__traceback__, and modifying exc.__traceback__ or creating a shim object just to be able to us

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-07-24 Thread Berker Peksag
New submission from Berker Peksag: Here is a patch that changes to use cls() instead of hardcoded TracebackException. Serhiy also suggested on IRC to use the from_exception() classmethod in TracebackException's __init__ method. -- components: Library (Lib) files: classmethod.diff keyw