From 7fef958a2fb559bdfeb136b55dc0d2ff3238d184 2016-03-02 16:58:54 From: Thomas Kluyver Date: 2016-03-02 16:58:54 Subject: [PATCH] Document custom key completions --- diff --git a/docs/source/config/integrating.rst b/docs/source/config/integrating.rst index c2c4b58..3630ae8 100644 --- a/docs/source/config/integrating.rst +++ b/docs/source/config/integrating.rst @@ -11,6 +11,14 @@ To change the attributes displayed by tab-completing your object, define a ``__dir__(self)`` method for it. For more details, see the documentation of the built-in `dir() function `_. +You can also customise key completions for your objects, e.g. pressing tab after +``obj["a``. To do so, define a method ``_ipython_key_completions_()``, which +returns a list of objects which are possible keys in a subscript expression +``obj[key]``. + +.. versionadded:: 5.0 + Custom key completions + Rich display ============