def menu_position() -> int | None:
                """
                When there is no autocompletion menu to be shown, and we have a
                signature, set the pop-up position at `bracket_start`.
                """
                b = python_input.default_buffer

                if python_input.signatures:
                    row, col = python_input.signatures[0].bracket_start
                    index = b.document.translate_row_col_to_index(row - 1, col)
                    return index
                return None

                When there is no autocompletion menu to be shown, and we have a
                signature, set the pop-up position at `bracket_start`.
                
src/ptpython/layout.py