Re: [Python-ideas] Function arguments in tracebacks

2016-12-30 Thread Nick Coghlan
On 29 December 2016 at 08:13, Nathaniel Smith wrote: > On Dec 28, 2016 12:44, "Brett Cannon" wrote: > > My quick on-vacation response is that attaching more objects to exceptions > is typically viewed as dangerous as it can lead to those objects being kept > alive longer than expected (see the d

Re: [Python-ideas] Function arguments in tracebacks

2016-12-28 Thread Mahmoud Hashemi
On Wed, Dec 28, 2016 at 2:13 PM, Nathaniel Smith wrote: > On Dec 28, 2016 12:44, "Brett Cannon" wrote: > > My quick on-vacation response is that attaching more objects to exceptions > is typically viewed as dangerous as it can lead to those objects being kept > alive longer than expected (see th

Re: [Python-ideas] Function arguments in tracebacks

2016-12-28 Thread Nathaniel Smith
On Dec 28, 2016 12:44, "Brett Cannon" wrote: My quick on-vacation response is that attaching more objects to exceptions is typically viewed as dangerous as it can lead to those objects being kept alive longer than expected (see the discussions about richer error messages to see that worry come ou

Re: [Python-ideas] Function arguments in tracebacks

2016-12-28 Thread MRAB
On 2016-12-28 21:01, Emanuel Landeholm wrote: I think an argument could be made for including the str() of parameters of primitive types and with small values (for some value of "primitive" and "small", can of worms here...). I'm thinking numbers and short strings. Maybe a flag to control this be

Re: [Python-ideas] Function arguments in tracebacks

2016-12-28 Thread Emanuel Landeholm
I think an argument could be made for including the str() of parameters of primitive types and with small values (for some value of "primitive" and "small", can of worms here...). I'm thinking numbers and short strings. Maybe a flag to control this behaviour? My gut feeling is that this would be a

Re: [Python-ideas] Function arguments in tracebacks

2016-12-28 Thread Brett Cannon
My quick on-vacation response is that attaching more objects to exceptions is typically viewed as dangerous as it can lead to those objects being kept alive longer than expected (see the discussions about richer error messages to see that worry come out for something as simple as attaching the type

[Python-ideas] Function arguments in tracebacks

2016-12-27 Thread Ammar Askar
Consider the following similar C and Python code and their tracebacks: C --- int divide(int x, int y, char* some_string) { return x / y; } int main(...) { divide(2, 0, "Hello World"); } --- Program received signal SIGFPE, Arithmetic exception. (gdb) bt #0 0x0