Skip to content

Commit eb6ef91

Browse files
author
y-p
committed
Merge pull request #5565 from y-p/PR_GH5147_fast_config_lookup
ENH: short-circuit config lookup when exact key given GH5147
2 parents 87d8ded + ad1bd44 commit eb6ef91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/core/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ def _select_options(pat):
512512
if pat=="all", returns all registered options
513513
"""
514514

515+
# short-circuit for exact key
516+
if pat in _registered_options:
517+
return [pat]
518+
519+
# else look through all of them
515520
keys = sorted(_registered_options.keys())
516521
if pat == 'all': # reserved key
517522
return keys

0 commit comments

Comments
 (0)