From 0dbb56bbb53464a91997a007dd7f1501d30ac464 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 27 Dec 2010 18:56:41 +0000 Subject: [PATCH] Verify parameter types passed to Bind() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/event_ex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/event_ex.py b/src/event_ex.py index 7dfdb7fa..f50e4063 100644 --- a/src/event_ex.py +++ b/src/event_ex.py @@ -16,7 +16,7 @@ class PyEventBinder(object): def Bind(self, target, id1, id2, function): - """Bind this set of event types to target using its COnnect() method.""" + """Bind this set of event types to target using its Connect() method.""" for et in self.evtType: target.Connect(id1, id2, et, function) @@ -65,6 +65,9 @@ def _EvtHandler_Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ :param id2: Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE. """ + assert isinstance(event, wx.PyEventBinder) + assert callable(handler) + assert source is None or hasattr(source, 'GetId') if source is not None: id = source.GetId() event.Bind(self, id, id2, handler)