Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle.

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


g.brandl at gmx

May 27, 2012, 11:53 PM

Post #1 of 5 (135 views)
Permalink
Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle.

Am 28.05.2012 03:55, schrieb terry.reedy:
> http://hg.python.org/cpython/rev/4a7582866735
> changeset: 77195:4a7582866735
> branch: 3.2
> parent: 77189:6737c2ca98ee
> user: Terry Jan Reedy <tjreedy [at] udel>
> date: Sun May 27 21:29:17 2012 -0400
> summary:
> Issue12510: Attempting to get invalid tooltip no longer closes Idle.
> Original patch by Roger Serwy.
>
> files:
> Lib/idlelib/CallTips.py | 9 ++++++---
> Misc/NEWS | 3 +++
> 2 files changed, 9 insertions(+), 3 deletions(-)
>
>
> diff --git a/Lib/idlelib/CallTips.py b/Lib/idlelib/CallTips.py
> --- a/Lib/idlelib/CallTips.py
> +++ b/Lib/idlelib/CallTips.py
> @@ -110,7 +110,9 @@
> namespace.update(__main__.__dict__)
> try:
> return eval(name, namespace)
> - except (NameError, AttributeError):
> + # any exception is possible if evalfuncs True in open_calltip
> + # at least Syntax, Name, Attribute, Index, and Key E. if not

Is something missing here? The comment text seems cut off.

> + except:
> return None

"except Exception" may be better here.

Georg

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


tjreedy at udel

May 28, 2012, 6:44 PM

Post #2 of 5 (121 views)
Permalink
Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle. [In reply to]

On 5/28/2012 2:53 AM, Georg Brandl wrote:
> Am 28.05.2012 03:55, schrieb terry.reedy:

>> namespace.update(__main__.__dict__)
>> try:
>> return eval(name, namespace)
>> - except (NameError, AttributeError):
>> + # any exception is possible if evalfuncs True in open_calltip
>> + # at least Syntax, Name, Attribute, Index, and Key E. if not
>
> Is something missing here? The comment text seems cut off.

There should be a ; at the end of the first line, but I think I will
rewrite the comment instead.

>> + except:
>> return None
>
> "except Exception" may be better here.

Idle's Shell catches all exceptions. I think the attempt to provide an
optional help (a function signature) should too.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


brian at python

May 28, 2012, 6:48 PM

Post #3 of 5 (119 views)
Permalink
Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle. [In reply to]

On Mon, May 28, 2012 at 8:44 PM, Terry Reedy <tjreedy [at] udel> wrote:
>>> +            except:
>>>                  return None
>>
>>
>> "except Exception" may be better here.
>
>
> Idle's Shell catches all exceptions. I think the attempt to provide an
> optional help (a function signature) should too.

Can you explain what this means? You should probably not have a bare
except - I'm not sure what IDLE has to do with it.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


tjreedy at udel

May 28, 2012, 7:59 PM

Post #4 of 5 (120 views)
Permalink
Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle. [In reply to]

On 5/28/2012 9:48 PM, Brian Curtin wrote:
> On Mon, May 28, 2012 at 8:44 PM, Terry Reedy<tjreedy [at] udel> wrote:

snipped context: return eval(user_entered_expression, namespace)

>>>> + except:
>>>> return None
>>>
>>>
>>> "except Exception" may be better here.
>>
>>
>> Idle's Shell catches all exceptions. I think the attempt to provide an
>> optional help (a function signature) should too.
>
> Can you explain what this means?

What what means? I am not sure what you are asking.
The issue might help http://bugs.python.org/issue12510

> You should probably not have a bare except

Idle code already has many of them Some perhaps should not be, but I
cannot tell with my current level of understanding of how Idle works.
Would you prefer 'except BaseException:' ?

> I'm not sure what IDLE has to do with it.

This is a patch to Idle.

tjr

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


tjreedy at udel

May 29, 2012, 5:08 PM

Post #5 of 5 (109 views)
Permalink
Re: cpython (3.2): Issue12510: Attempting to get invalid tooltip no longer closes Idle. [In reply to]

On 5/28/2012 10:59 PM, Terry Reedy wrote:
> On 5/28/2012 9:48 PM, Brian Curtin wrote:

> > You should probably not have a bare except
>
> Idle code already has many of them

At least 29 by grep. After further discussion, Roger Serwy and I have
agreed that we should start reducing that number rather than increasing
it. There is a nearby 'except:' that I believe should be 'except
AttributeError:'.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.