You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reconsider gh-88915 changes rlcompleter since exceptions in descriptors cause auto completion to fail #112821
It looks like when investigating/solving this issue, it was unconsidered that @property isn't the only case where calling an underlying method might be undesirable. For example, in the NVDA project, we have the following non-data descriptor (simplified for clarity):
If we'd create an instance of SomeClass and try to autocomplete, rlcompleter.Completer.attr_matches would fail with the NotImplementedError raised by some_prop
Create abstract classes for descriptors in _collections_abc (e.g. ImplementsGet, ImplementsSet, ImplementsDelete) and in rlcompleter, rather than checking for isinstance(obj, property), use isinstance(obj, ImplementsGet). This might cause false positives for method descriptors though.
Hello,
if the class' property is created with Cython (0.29 or 3.0.8), it also fails the isinstance(..., property) test mentioned by @LeonarddeR .
So rlcompleter also fails on these cython classes when the property raises an exception.
changed the title [-]Reconsider BPO 44752 changes in rlcompleter since exceptions in descriptors cause auto completion to fail[/-][+]Reconsider gh-88915 changes rlcompleter since exceptions in descriptors cause auto completion to fail[/+]on May 8, 2026
Activity
LeonarddeR commentedon Dec 7, 2023
@jdevries3133 since you worked on this code, it would be most valuable if you could share your opinion on this.
JeanDidierGaraud commentedon Mar 20, 2024
Hello,
if the class' property is created with Cython (0.29 or 3.0.8), it also fails the
isinstance(..., property)test mentioned by @LeonarddeR .So rlcompleter also fails on these cython classes when the property raises an exception.
I've set up a small reproducible example here: https://github.com/Demi-Lune/cython_property_is_attribute.
This example worked fine with python3.8.
For example:
produces:
So I'm in favor of @LeonarddeR 's first suggestion (Restore the try/except).
mdboom commentedon May 8, 2026
A reproducer using only builtins:
[-]Reconsider BPO 44752 changes in rlcompleter since exceptions in descriptors cause auto completion to fail[/-][+]Reconsider gh-88915 changes rlcompleter since exceptions in descriptors cause auto completion to fail[/+]pythongh-112821: Fix rlcompleter failures on objects with descriptors
gh-112821: Fix rlcompleter failures on objects with descriptors (#149577
[3.15] gh-112821: Fix rlcompleter failures on objects with descriptors (
[3.14] gh-112821: Fix rlcompleter failures on objects with descriptors (
[3.13] gh-112821: Fix rlcompleter failures on objects with descriptors (