diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index cba7774..415f088 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -47,16 +47,29 @@ except ModuleNotFoundError: def __init__(self, path): pass - def get(self, key, default): + def get(self, key, default=None): warn( - f"using {key} requires you to install the `pickleshare` library.", + f"This is now an optional IPython functionality, using {key} requires you to install the `pickleshare` library.", stacklevel=2, ) return default + def __getitem__(self, key): + warn( + f"This is now an optional IPython functionality, using {key} requires you to install the `pickleshare` library.", + stacklevel=2, + ) + return None + def __setitem__(self, key, value): warn( - f"using {key} requires you to install the `pickleshare` library.", + f"This is now an optional IPython functionality, setting {key} requires you to install the `pickleshare` library.", + stacklevel=2, + ) + + def __delitem__(self, key): + warn( + f"This is now an optional IPython functionality, deleting {key} requires you to install the `pickleshare` library.", stacklevel=2, ) diff --git a/IPython/extensions/storemagic.py b/IPython/extensions/storemagic.py index d9d00f1..f3bc8f6 100644 --- a/IPython/extensions/storemagic.py +++ b/IPython/extensions/storemagic.py @@ -145,7 +145,7 @@ class StoreMagics(Magics): if args: for arg in args: try: - obj = db['autorestore/' + arg] + obj = db["autorestore/" + arg] except KeyError: try: restore_aliases(ip, alias=arg)