Skip to content

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

Open
@sobolevn

Description

@sobolevn

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

Activity

self-assigned this
on May 19, 2025
added
type-bugAn unexpected behavior, bug, or error
buildThe build process and cross-build
on May 19, 2025
added a commit that references this issue on May 19, 2025

pythongh-134294: Fix `Uop.replicated` field definition and usage

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

Metadata

Metadata

Assignees

Labels

buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Fix `Uop.replicated` definition in `cases_generator/analyzer.py` · Issue #134294 · python/cpython

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant