From ad1bd4481fb9ad69df8c07a0b38b46c0987f98e2 Mon Sep 17 00:00:00 2001 From: y-p Date: Thu, 21 Nov 2013 14:35:29 +0200 Subject: [PATCH] ENH: short-circuit config lookup when exact key given GH5147 --- pandas/core/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/core/config.py b/pandas/core/config.py index ac48232ec618f..bb591947d21de 100644 --- a/pandas/core/config.py +++ b/pandas/core/config.py @@ -512,6 +512,11 @@ def _select_options(pat): if pat=="all", returns all registered options """ + # short-circuit for exact key + if pat in _registered_options: + return [pat] + + # else look through all of them keys = sorted(_registered_options.keys()) if pat == 'all': # reserved key return keys