Skip to content

bpo-44752: Make rlcompleter not call @property methods - #27401

Merged
ambv merged 3 commits into
python:mainfrom
jdevries3133:bpo-44752-rlcompleter
Jul 29, 2021
Merged

bpo-44752: Make rlcompleter not call @property methods#27401
ambv merged 3 commits into
python:mainfrom
jdevries3133:bpo-44752-rlcompleter

Conversation

@jdevries3133

@jdevries3133jdevries3133 commented Jul 28, 2021

Copy link
Copy Markdown
Contributor
  • rlcompleter was calling these methods to identify whether to add
    parenthesis to the completion, based on if the attribute is callable.
  • for property objects, completion with parenthesis are never desirable.
  • property methods with print statements behaved very strangely, which
    was especially unfriendly to language newcomers. could suddenly
    produce output unexpectedly.

https://bugs.python.org/issue44752

* rlcompleter was calling these methods to identify whether to add
parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
was especially unfriendly to language newcomers. <tab> could suddenly
produce output unexpectedly.
Comment threadLib/rlcompleter.py
Comment threadLib/rlcompleter.py
Comment threadLib/test/test_rlcompleter.py Outdated
@jdevries3133

Copy link
Copy Markdown
ContributorAuthor

@ambv, I see what you mean now about that change weakening the test. I created a new test case, and revised the original one to use the original assertions, now using __getattribute__ instead of @property since @property is now special-cased.

@ambvambv changed the title bpo-44752: rlcompleter does not call @property methodsbpo-44752: Make rlcompleter not call @property methodsJul 29, 2021
@ambv
ambv merged commit 50de8f7 into python:mainJul 29, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @jdevries3133 for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 29, 2021
)
* rlcompleter was calling these methods to identify whether to add
parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
was especially unfriendly to language newcomers. <tab> could suddenly
produce output unexpectedly.
(cherry picked from commit 50de8f7)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27444 is a backport of this pull request to the 3.10 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.10 only security fixes label Jul 29, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 29, 2021
)
* rlcompleter was calling these methods to identify whether to add
parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
was especially unfriendly to language newcomers. <tab> could suddenly
produce output unexpectedly.
(cherry picked from commit 50de8f7)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

GH-27445 is a backport of this pull request to the 3.9 branch.

ambv pushed a commit that referenced this pull request Jul 29, 2021
…H-27444)
* rlcompleter was calling these methods to identify whether to add
parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
was especially unfriendly to language newcomers. <tab> could suddenly
produce output unexpectedly.
(cherry picked from commit 50de8f7)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
ambv pushed a commit that referenced this pull request Jul 29, 2021
…27445)
* rlcompleter was calling these methods to identify whether to add
parenthesis to the completion, based on if the attribute is callable.
* for property objects, completion with parenthesis are never desirable.
* property methods with print statements behaved very strangely, which
was especially unfriendly to language newcomers. <tab> could suddenly
produce output unexpectedly.
(cherry picked from commit 50de8f7)
Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@jdevries3133@miss-islington@bedevere-bot@ambv@the-knights-who-say-ni