[New-bugs-announce] [issue1252] IDLE - patch Delegator to support callables

Tal Einat report at bugs.python.org
Wed Oct 10 04:06:52 CEST 2007


New submission from Tal Einat:

Add an __call__ magic method to Delegator so that it can delegate to
callables. This will raise the required exception if the delegate isn't
callable.

The built-in callable() method will now return True for any Delegator.
Before this patch it always returns False, which is wrong if the
delegate is callable, so callable() doesn't really work on Delegator
instances in both cases. I couldn't see how this could be harmful.

Also make the Delegator class a new-style class.


This patch is required for the Squeezer and ShellLogger IDLE extensions
found on PyPI to be able to co-exist.

----------
components: IDLE
files: IDLE_Delegator.071010.patch
messages: 56305
nosy: kbk, taleinat
severity: normal
status: open
title: IDLE - patch Delegator to support callables
type: behavior
versions: Python 2.5, Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1252>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IDLE_Delegator.071010.patch
Type: application/octet-stream
Size: 639 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071010/7af481a2/attachment.obj 


More information about the New-bugs-announce mailing list