Issue 5256: rlcompleter adds builtins when custom dict is used (original) (raw)

Created on 2009-02-14 00:04 by armandas, last changed 2022-04-11 14:56 by admin.

Files
File name Uploaded Description Edit
rlcompleter.patch maker,2010-08-07 07:27 issue5256 fix + unittests review
rlcompleter_docs.patch maker,2010-08-07 15:38 issue5256 doc review
issue5256.patch maker,2012-10-14 20:59
issue5256.1.patch maker,2012-10-15 20:08
Messages (9)
msg81979 - (view) Author: Armandas (armandas) Date: 2009-02-14 00:04
When custom dictionary is used to create a completer, rlcompleter still uses __builtins__.__dict__ to search for completions (rlcompleter.py, global_matches()): for nspace in [builtins.__dict__, self.namespace]: ... This behaviour may sometimes be unwanted. It would be nice to have an option, which when set would tell completer to only use provided dictionary.
msg113154 - (view) Author: Michele Orrù (maker) * Date: 2010-08-07 07:27
The attached patch fixes this issue and provides some tests.
msg113169 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-08-07 12:04
The report says “This behaviour may sometimes be unwanted. It would be nice to have an option”, so I’m requalifying as a RFE and adjusting versions. The patch changes behavior (search order was builtins, self.namespace and is now reversed), is this wanted? The patch also needs to update the doc. Thanks!
msg113180 - (view) Author: Michele Orrù (maker) * Date: 2010-08-07 15:21
Yes, it is. I think the user would expect that kind of behaviour. The attached patch updates the Doc.
msg172914 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-10-14 20:24
Looks good to me. I wrote one comment on the doc patch review.
msg172921 - (view) Author: Michele Orrù (maker) * Date: 2012-10-14 20:59
Updated with tip, and merged with documentation.
msg172955 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-10-15 10:37
I would make the argument keyword-only. Changing the logic to avoid eval() might be OK, but IIUC is not related to this issue, and it should be done separately. The markup in the doc could be better (`...` should be ``...`` or a more specific directive that generates a link). A versionchanged should be added as well.
msg172999 - (view) Author: Michele Orrù (maker) * Date: 2012-10-15 20:08
Updated. Note that removing `eval` is necessary for the new logic of the function.
msg348652 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 12:02
This issue is not newcomer friendly, I remove the easy keyword.
History
Date User Action Args
2022-04-11 14:56:45 admin set github: 49506
2019-07-29 12:02:35 vstinner set keywords: - easynosy: + vstinnermessages: +
2012-10-15 20:08:48 maker set files: + issue5256.1.patchmessages: +
2012-10-15 10:37:03 ezio.melotti set messages: +
2012-10-14 20:59:22 maker set files: + issue5256.patchmessages: +
2012-10-14 20:24:35 eric.araujo set messages: +
2012-10-14 20:19:46 eric.araujo set keywords: + needs reviewversions: + Python 3.4, - Python 3.2
2010-08-07 15:38:59 maker set files: + rlcompleter_docs.patch
2010-08-07 15:38:24 maker set files: - rlcompleter_docs.patch
2010-08-07 15:21:38 maker set files: + rlcompleter_docs.patchmessages: +
2010-08-07 12:04:21 eric.araujo set versions: - Python 3.1, Python 2.7nosy: + eric.araujomessages: + type: behavior -> enhancementstage: test needed -> patch review
2010-08-07 07:29:29 maker set nosy: + mark.dickinson, pitrou, ezio.melotti, r.david.murray
2010-08-07 07:27:07 maker set files: + rlcompleter.patchnosy: + makermessages: + keywords: + patch
2010-07-10 16:35:13 BreamoreBoy set components: + Library (Lib), - Noneversions: + Python 3.1, Python 2.7, Python 3.2, - Python 3.0
2009-04-22 17🔞09 ajaksu2 set keywords: + easystage: test needed
2009-02-14 00:04:18 armandas create