8000 Fix `Uop.replicated` definition in `cases_generator/analyzer.py` · Issue #134294 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Fix Uop.replicated definition in cases_generator/analyzer.py #134294

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

Open
sobolevn opened this issue May 19, 2025 · 0 comments
8000
Open

Fix Uop.replicated definition in cases_generator/analyzer.py #134294

sobolevn opened this issue May 19, 2025 · 0 comments
Assignees
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member
sobolevn commented May 19, 2025

Bug report

It is now defined as:

And used as:

for anno in op.annotations:
if anno.startswith("replicate"):
result.replicated = int(anno[10:-1])
break
else:
return result

But, right now replicated is a class-level variable of a dataclass, because it does not have an annotation, see:

>>> from dataclasses import dataclass
>>> @dataclass
... class Uop:
...     replicated = 0
...     
>>> Uop(replicated=1)
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    Uop(replicated=1)
    ~~~^^^^^^^^^^^^^^
TypeError: Uop.__init__() got an unexpected keyword argument 'replicated'

I have a PR with the fix.

Refs 626c414

Linked PRs

@sobolevn sobolevn self-assigned this May 19, 2025
@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error build The build process and cross-build labels May 19, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant
0