# wrong auto-completion in python shell

**URL:** https://discourse.paraview.org/t/wrong-auto-completion-in-python-shell/17707
**Category:** ParaView Support
**Created:** [August 31, 2026, 7:26am UTC](https://discourse.paraview.org/t/wrong-auto-completion-in-python-shell/17707 "2026-08-31T07:26:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [August 31, 2026, 7:26am UTC](https://discourse.paraview.org/t/wrong-auto-completion-in-python-shell/17707/1 "2026-08-31T07:26:53Z")

</div>

Hello,  
I came across a bug with the auto completion in functions in the python shell.  
if we define a function with default values such as:

```auto
def add(firstValue=0,secondValue=1):
    return firstValue+secondValue

```

so we can use it with no defined inputs as: `add()` (it is a dummy example to reproduce the issue)

1. if we go up (so come back to previous line to re do the call, but modifying something.) in my case i came across when doing this and wanting to call the function with same parameters but change a default flag. so we get `add()` but modifiable
2. we go inside the `()` of the add, and type `fir` so, the line would look like this: `add(fir|)` the `|` is to indicate where the pointer of the wrinting is at that moment
3. we hit tab to autocomplete to `firstValue`, (classic behavior of python) instead of getting `add(firstValue)` as one should get (and as one gets if it begings from a blank `add(`) one gets `add(firfirstValue`

A. so there is a bug in the autocompletion.  
B. i also notice that if we fill up the first input of the function, put a comma and try to auto fill the second input it does not auto fill. should i make a feature request for this?

edit: for the case of A. the bug comes directly from trying to use the auto fill not when going back to previous line, but simply if one wants to fill up a function that has already the parentesis closed. so if one defines the add function as i give in the example, and type `add()` put the cursor inside the `()` and writes `fir` and hit tab, it will become `add(firfirstValue`

**EDIT:**  
okey more investigation on this, it looks like the behavior is:

- if i am auto completing and have text after it, it will add the autocompletion BUT it will erase partially or totally what is after. so something like(the `|` is to indicate current position where one hit tab): `myObject.get|XXXX` and gets suggested `getPart` if one hits enter what is wrote, it will simply disappear and the text will become `myObject.getPart` with the missing `XXXX`

- also a particular case, if there is a parenthesis before the tab hit,so for example `myObject.get|(flag`, in this case it will also remove the things after (not fully sure HOW it is removing the after as sometimes i am getting a section of the after still there, sometimes it is fully gone.) the insertion but also leave the things before! so one gets `myObject.getgetPart`
