Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-145413: Fix nested attribute suggestions executing property code#145414

Open
Hiumee wants to merge 3 commits intopython:mainfrom
Hiumee:fix-issue-145413
Open

gh-145413: Fix nested attribute suggestions executing property code#145414
Hiumee wants to merge 3 commits intopython:mainfrom
Hiumee:fix-issue-145413

Conversation

@Hiumee
Copy link

@HiumeeHiumee commentedMar 2, 2026
edited by github-actionsbot
Loading

Updated the code of_check_for_nested_attribute to check properties without triggering their code. This approach will still suggest them

Changed a test case to look for side effects and changed some contradictory comments

Updated the news section code to include imports so the code can be tested out of the box

Example

fromdataclassesimportdataclassfrommathimportpi@dataclassclassCircle:radius:float@propertydefarea(self)->float:print("Property 'area' accessed")returnpi*self.radius**2classContainer:def__init__(self,inner:Circle)->None:self.inner=innercircle=Circle(radius=4.0)container=Container(circle)print(container.area)

Output

Traceback (most recent call last):  File "<stdin>", line 1, in <module>    print(container.area)          ^^^^^^^^^^^^^^AttributeError: 'Container' object has no attribute 'area'. Did you mean '.inner.area' instead of '.area'?

It doesn't reach the print statement at all


📚 Documentation preview 📚:https://cpython-previews--145414.org.readthedocs.build/

@python-cla-bot
Copy link

python-cla-botbot commentedMar 2, 2026
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

@johnslavikjohnslavikAwaiting requested review from johnslavik

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@Hiumee

[8]ページ先頭

©2009-2026 Movatter.jp