[Twisted-Python] Exception's Implicit Public API, and Python 3

Tom Most tommost at gmail.com
Mon Sep 7 22:44:54 MDT 2015


Would str(failure.value) work?  It should be stable from 2.x to 3.x,
barring Unicode differences:

https://docs.python.org/2/library/exceptions.html#exceptions.BaseException
https://docs.python.org/3.5/library/exceptions.html#BaseException

(This convention is quite handy when you want to defer formatting of a
fancy exception message.  Just pass args to the constructor and override
__str__ to do the expensive formatting.)

---Tom

On 09/06/2015 01:20 PM, Tobias Oberstein wrote:
>> Put differently, Twisted's "the first one's free" policy applies to
>> upgrading Twisted itself, and /not/ to upgrading Python (or any other
>> dependency).  If you upgrade Python and you need to update your code for
>> that, Twisted won't create any additional problems but it won't go out
>> of its way to solve the ones you normally have to deal with.
>>
>> Sound good?
>
> Sounds good. We're fine.
>
> FWIW, we need to guard for even more cases
>
> .message there
> .args there _and_ a tuple _and_ of length > 0
>
> https://github.com/tavendo/AutobahnPython/commit/303d289de4993b5ffa9bf90c6fed71364f3521e7#diff-ced6a7641cc1e78205bd85d77b484c03R111
>
>
> /Tobias
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




More information about the Twisted-Python mailing list