spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.34k stars 1.62k forks source link

Outline explorer seeing imported symbols from relative import with tuple syntax #16352

Closed gb119 closed 2 years ago

gb119 commented 3 years ago

What steps will reproduce the problem?

I have a django project that does some imports as follows:

from .models import Marksheet, MarkType, ProjectAssignment, Project, StudentReport
from .forms import (
    MarksheetListForm,
    ProjectAssignmentForm,
    FinalizeMarksForm,
    ProjectCopySourceForm,
    ProjectAssignmentFilter,
    BulkMarksheetsImportForm,
    BulkTurnitinImportForm,
    BulkUploadMinervaAssignmentForm,
)
from .tables import BaseTable, MarkColumn, ProjectTable, AllProjectTable

In 5.1.2 nearly all of these symbols are correctly suppressed in the outline explorer EXCEPT for the import from .forms.

It's not as simple as the tuple syntax in the import as I also have the following lines which are all correctly suppressed:

from phys_utils.views import (
    IsStaffViewMixin,
    IsSuperuserViewMixin,
    MultiFormMixin,
    FormListView,
)
from phys_utils.response import PDF_TemplateResponse, CSV_TemplateResponse

So it seems like it is a combination of both the relative package import and the tuple syntax.

Unfortunately, black is rath fond of the tuple formatting of the long import :-) !

ccordoba12 commented 3 years ago

Hey @gb119, thanks for reporting. I'll take a look at this one for 5.2.0 (hopefully it won't be too hard to solve).