[issue20703] RuntimeError caused by lazy imports in pdb

Serhiy Storchaka report at bugs.python.org
Mon Aug 2 02:11:15 EDT 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Having a side effect at import time is not good. It will interfere with programs which just import pdb, but not use it.

There are two other options:

1. Import readline at top level, but call set_completer_delims() lazily.

2. Do not import readline at all. Call set_completer_delims() only if readline is already imported (sys.modules.get('readline') is not None).

I prefer the latter one.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20703>
_______________________________________


More information about the Python-bugs-list mailing list