Skip to content

gh-134451: Delete @dataclass for asyncio.tools.CycleFoundException class #134513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2025

Conversation

RenameMe1
Copy link
Contributor

@RenameMe1 RenameMe1 commented May 22, 2025

@python-cla-bot
Copy link

python-cla-bot bot commented May 22, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented May 22, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@RenameMe1
Copy link
Contributor Author

@sobolevn can you see, please?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use __hash__ / __eq__ / __gt__ or something with this class?

@kumaraditya303 kumaraditya303 enabled auto-merge (squash) May 23, 2025 04:50
@kumaraditya303 kumaraditya303 added the needs backport to 3.14 bugs and security fixes label May 23, 2025
@kumaraditya303
Copy link
Contributor

Do we use hash / eq / gt or something with this class?

No, dataclass was used to just avoid manually writing __init__.

@sobolevn sobolevn changed the title gh-134451: Deleted @dataclass for asyncio.tools. CycleFoundException class gh-134451: Delete @dataclass for asyncio.tools.CycleFoundException class May 23, 2025
@kumaraditya303 kumaraditya303 merged commit f9324cb into python:main May 23, 2025
45 checks passed
@miss-islington-app
Copy link

Thanks @RenameMe1 for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 23, 2025
…ataclass to a regular exception type. (pythonGH-134513)

(cherry picked from commit f9324cb)

Co-authored-by: Evgeny Demchenko <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 23, 2025

GH-134564 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 23, 2025
@sobolevn
Copy link
Member

Oh, never mind - these were just my small nitpicks :)
Thanks, @RenameMe1!

kumaraditya303 pushed a commit that referenced this pull request May 23, 2025
…dataclass to a regular exception type. (GH-134513) (#134564)

gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (GH-134513)
(cherry picked from commit f9324cb)

Co-authored-by: Evgeny Demchenko <[email protected]>
@ericvsmith
Copy link
Member

I think this change was a mistake, and should be rolled back. A better, more compatible change would be to make it a non-frozen dataclass.

@sobolevn
Copy link
Member

sobolevn commented May 24, 2025

@ericvsmith can you please explain why? Did we miss some extra dataclass-generated methods? Or is fields() used somewhere on instances of this type?

@ericvsmith
Copy link
Member

ericvsmith commented May 24, 2025

Because we don't know everywhere it's used. Why take the chance of breaking things? I think it's a good idea to make the smallest possible change to fix the problem, and that would be an unfrozen dataclass.

I've broken plenty of things over the years with similar small changes. We should be very careful with any change.

@sobolevn
Copy link
Member

@ericvsmith I think that it is fine, it was added 3 weeks ago 2bc8365#diff-2aec630227e154e015d98ccdb65d86f6ad365e1d029bbe6289933b7ad41b69f3R17 and I think that people did not have time to really use it and attach to small implementation details. In my opinion, it is a right time for this change.

But, I am open for other opinions / reverting this, if there are actual things that we broke 🤝

@ericvsmith
Copy link
Member

I didn't realize it was new. In that case, I'm mostly okay with it. But since it's after Beta 1, you might want to check with the Release Manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants