From 998f11ec9caeaa3551c29108b950b07f2dc7dda6 2006-06-23 12:52:50 From: walter.doerwald Date: 2006-06-23 12:52:50 Subject: [PATCH] Add a __delitem__() method to Keymap. --- diff --git a/IPython/Extensions/ibrowse.py b/IPython/Extensions/ibrowse.py index 1e3646c..46b31dd 100644 --- a/IPython/Extensions/ibrowse.py +++ b/IPython/Extensions/ibrowse.py @@ -46,15 +46,20 @@ class Keymap(dict): else: dict.__setitem__(self, key, command) - def register(self, command, *keys): - for key in keys: - self[key] = command - def __getitem__(self, key): if isinstance(key, str): key = ord(key) return dict.__getitem__(self, key) + def __detitem__(self, key): + if isinstance(key, str): + key = ord(key) + dict.__detitem__(self, key) + + def register(self, command, *keys): + for key in keys: + self[key] = command + def get(self, key, default=None): if isinstance(key, str): key = ord(key)