[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 transformation of frames.

I'd be much happier about looking at subclassability after we had that in place.

Anyhow, since I did apply the change this issue was specifically about (the 
third hunk in the patches), I'm going to close this now.

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

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



[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

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 use from_exception doesn't make sense to me.

This patch looks good, and I'm applying to 3.6. It has no functional impact 
(except for perhaps weird mocking corner cases, but as its a pure class that 
shouldn't be needed), so I'm leaving it out of 3.5, since i'm not 100% sure 
where the move to a new repo is at, and its not worth figuring that out.

--

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



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

--

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



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue24710
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/file40020/classmethod_2.patch

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



[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
keywords: patch
messages: 247301
nosy: berker.peksag, rbcollins, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Class name hardcoded in TracebackException.from_exception()
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40008/classmethod.diff

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