-
Notifications
You must be signed in to change notification settings - Fork 83
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
core: make TypedAttribute printing generic #3490
Conversation
if isinstance(attribute, TypedAttribute): | ||
attribute.print_without_type(self) | ||
self.print_string(" : ") | ||
self.print_attribute(attribute.parameters[attribute.get_type_index()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line which needs get_type_index
to be a classmethod
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3490 +/- ##
=======================================
Coverage 90.31% 90.31%
=======================================
Files 462 462
Lines 58039 58040 +1
Branches 5562 5563 +1
=======================================
+ Hits 52417 52419 +2
Misses 4188 4188
+ Partials 1434 1433 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
This currently doesn't really do anything because `IntegerAttr` is the only `TypedAttribute`. But after future PRs this will unify the way in which `TypedAttribute` is printed.
This currently doesn't really do anything because
IntegerAttr
is the onlyTypedAttribute
. But after future PRs this will unify the way in whichTypedAttribute
is printed.There is a potential worry about circularity here if someone calls
print_attribute
inprint_without_type
but I think this would have caused problems anyway