[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

[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 rep...@bugs.python.org http://bugs.python.org/issue24710 ___

[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

[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 storch...@gmail.com: -- resolution: fixed - stage: resolved - patch review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24710 ___

[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 rep...@bugs.python.org http://bugs.python.org/issue24710 ___ ___

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

2015-07-25 Thread Robert Collins
Changes by Robert Collins robe...@robertcollins.net: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24710 ___

[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 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:

[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