Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-28 Thread Chris Angelico
On Sat, Oct 29, 2016 at 8:36 AM, Sven R. Kunze wrote: > Another issue I encounter regularly are things like: > func(mylist[i], mylist2[j]) > > IndexError: list index out of range > > > So, which are the list and index that cause the error? +1. Showing the list's contents

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-28 Thread Sven R. Kunze
Great idea! Another issue I encounter regularly are things like: >>> func(mylist[i], mylist2[j]) IndexError: list index out of range So, which are the list and index that cause the error? On 25.10.2016 00:07, Ryan Gonzalez wrote: I personally find it kind of annoying when you have code

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Steven D'Aprano
On Tue, Oct 25, 2016 at 12:17:56PM -0700, Nathaniel Smith wrote: > I get that this list's default is to push > back on proposed changes, and it's a good principle in general, but > "improved error messages" are *really* cheap. The bar should be pretty > low, IMO. I think its even lower than

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Steven D'Aprano
On Tue, Oct 25, 2016 at 04:55:21PM -0500, Ryan Gonzalez wrote: > Also, as an extension of this idea, would it be possible to improve errors > like this: > > > class X: pass > X() # object() takes no parameters > > > to show the actual type instead of just 'object'? My wild guess is that the

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Ryan Gonzalez
Also, as an extension of this idea, would it be possible to improve errors like this: class X: pass X() # object() takes no parameters to show the actual type instead of just 'object'? On Tue, Oct 25, 2016 at 4:48 PM, Ryan Gonzalez wrote: > So, based on everyone's

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Ryan Gonzalez
So, based on everyone's feedback, I just created this: http://bugs.python.org/issue28536 On Mon, Oct 24, 2016 at 5:07 PM, Ryan Gonzalez wrote: > I personally find it kind of annoying when you have code like this: > > > x = A(1, B(2, 3)) > > > and Python's error message looks

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Chris Barker
On Tue, Oct 25, 2016 at 6:58 AM, Chris Angelico wrote: > > >>> tuple(foo) > > > > TypeError: 'int' object is not iterable > > > > No raiser, no value given. It's hard to find out what's the problem is. > The > > biggest issue here is that if you have a long line with

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Paul Moore
On 25 October 2016 at 20:17, Nathaniel Smith wrote: > I get that this list's default is to push > back on proposed changes, and it's a good principle in general, but > "improved error messages" are *really* cheap. The bar should be pretty > low, IMO. If someone's willing to do the

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Nathaniel Smith
On Tue, Oct 25, 2016 at 6:20 AM, Michel Desmoulin wrote: > Some things deserve a big explanation to solve the problem. It would be nice > to add a link to official tutorial in the documentation. > > E.G, encoding is a big one: > >In [8]: b'é' + 'é' > File "",

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Nathaniel Smith
On Tue, Oct 25, 2016 at 6:58 AM, Chris Angelico wrote: > On Wed, Oct 26, 2016 at 12:20 AM, Michel Desmoulin > wrote: >> list, set and tuple less not as good: >> >> >>> tuple(foo) >> >> TypeError: 'int' object is not iterable >> >> No raiser,

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Chris Angelico
On Wed, Oct 26, 2016 at 12:20 AM, Michel Desmoulin wrote: > list, set and tuple less not as good: > > >>> tuple(foo) > > TypeError: 'int' object is not iterable > > No raiser, no value given. It's hard to find out what's the problem is. The > biggest issue here

Re: [Python-ideas] Showing qualified names when a function call fails

2016-10-25 Thread Neil Girdhar
Also, for something like this: In [1]: class A: ...: pass ...: In [2]: A(x=2) --- TypeError Traceback (most recent call last) in () > 1 A(x=2) TypeError: object() takes no