GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-113978: Ignore warnings on text completion inside REPL by WolframAlph · Pull Request #113979 · python/cpython Conversation
sobolevn
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe instead we should do this? » git patch diff --git Lib/rlcompleter.py Lib/rlcompleter.py index 206d6fb511c..62fd2c7fdec 100644 --- Lib/rlcompleter.py +++ Lib/rlcompleter.py @@ -176,8 +176,9 @@ def attr_matches(self, text): if (word[:n] == attr and not (noprefix and word[:n+1] == noprefix)): match = "%s.%s" % (expr, word) + import types if isinstance(getattr(type(thisobject), word, None), - property): + (property, types.GetSetDescriptorType)): # bpo-44752: thisobject.word is a method decorated by # `@property`. What follows applies a postfix if # thisobject.word is callable, but know we know that
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
I agree. But is this true only for built-in objects and their properties or user defined as well? class D: def __get__(self, _, __): print("evaluated") class C: prop = D() trying to get suggestions for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We can also try to replace |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Some things depend on being evaluated. Using cpython/Lib/test/test_rlcompleter.py Lines 51 to 85 in 77b45fa
Things like |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @WolframAlph for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…onGH-113979) (cherry picked from commit e03dde5) Co-authored-by: Yan Yanchii <[email protected]>
|
GH-119429 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…113979) (#119429) (cherry picked from commit e03dde5) Co-authored-by: Yan Yanchii <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.