The inline condition filter will have a different ID after the parent function is called (a new PromptSession is created). It will be cached by some global condition filter (e.g., is_searching), causing the cached size to increase and never be freed.
Reference: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1835
Never/Always
is cached inprompt_toolkit.filters.utils._bool_to_filter
, and if it is the first condition, it will hold the filter and cannot be freed.The inline condition filter will have a different ID after the parent function is called (a new PromptSession is created). It will be cached by some global condition filter (e.g., is_searching), causing the cached size to increase and never be freed.