bpo-29854: test_readline logs versions in verbose mode by vstinner · Pull Request #2619 · python/cpython (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe we don't need the hasattr check?

I like the idea of using test_readline unchanged on Python implementations other than CPython. Tests cannot rely on private attributes in tests, not without @cpython_only or hasattr(). I added a comment to explain the rationale.

is_editline

Right, I also logged this flag, even if the other attributes are not available.

I chose to also expose rl_library_version as a private attribute to be able to log it in test_readline. It may help to debug subtle differences between two readline versions, and validate manually is_editline flag.