Skip to content

Migrated type and metadata field to NIRNode dataclass field factory#191

Open
Jegp wants to merge 1 commit into
mainfrom
update-dataclass
Open

Migrated type and metadata field to NIRNode dataclass field factory#191
Jegp wants to merge 1 commit into
mainfrom
update-dataclass

Conversation

@Jegp

@Jegp Jegp commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Uses a nifty Python 3.10 dataclass feature to add default dict constructors to the input_type, output_type, and metadata fields in NIRNode, which removes a lot of redundant lines in inherited classes

Comment thread nir/ir/graph.py

# Shape of incoming data. Overrides the keyword-only input_type from
# NIRNode so it can be passed positionally
input_type: Types

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this needs to be dropped, no?

@benkroehs benkroehs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good, just one minor question

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.

2 participants