This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jack__d
Recipients RPecor, jack__d
Date 2021-07-28.03:12:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Now that I see hasattr() uses getattr(), it looks like the tab completion issue might not stem from line 155, but from line 180 ( where it calls getattr().

That is correct! I was able to fix the undesirable behavior by adding an early exit condition if we appear to have a property object. I checked for the existence of a property object like this:

    class Foo:

        def bar(self):
            return 'baz'

    def is_property(object, attr):
        return isinstance(getattr(type(object), attr, None), property)

    assert is_property(Foo(), 'bar')

The code that follows line 180 in the loop just checks if ``object.attribute`` is callable, and whether the callable takes arguments in order to determine whether to add parenthesis to the completion. In my opinion, we never really want to add parenthesis when providing completion for a property attribute anyway, so there's no reason to go through that code block if we are dealing with a property.

I opened a GitHub PR. Let me know what you think!
Date User Action Args
2021-07-28 03:12:33jack__dsetrecipients: + jack__d, RPecor
2021-07-28 03:12:33jack__dsetmessageid: <>
2021-07-28 03:12:33jack__dlinkissue44752 messages
2021-07-28 03:12:33jack__dcreate