Skip to content

Commit

Permalink
more backcall removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Oct 24, 2023
1 parent 1c2687e commit 1a8be18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
5 changes: 2 additions & 3 deletions IPython/core/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ def trigger(self, event, *args, **kwargs):
available_events = {}

def _define_event(callback_function):
callback_proto = callback_prototype(callback_function)
available_events[callback_function.__name__] = callback_proto
return callback_proto
available_events[callback_function.__name__] = callback_function
return callback_function

# ------------------------------------------------------------------------------
# Callback prototypes
Expand Down
13 changes: 0 additions & 13 deletions IPython/core/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,3 @@ def func3(*_):
self.em.trigger('ping_received')
self.assertEqual([True, True, False], invoked)
self.assertEqual([func3], self.em.callbacks['ping_received'])

def test_ignore_event_arguments_if_no_argument_required(self):
call_count = [0]
def event_with_no_argument():
call_count[0] += 1

self.em.register('event_with_argument', event_with_no_argument)
self.em.trigger('event_with_argument', 'the argument')
self.assertEqual(call_count[0], 1)

self.em.unregister('event_with_argument', event_with_no_argument)
self.em.trigger('ping_received')
self.assertEqual(call_count[0], 1)

0 comments on commit 1a8be18

Please sign in to comment.