-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
fix[ux]: shorten interface name in error messages #4359
base: master
Are you sure you want to change the base?
Changes from 3 commits
8fa3305
97c7d02
e93853e
f6b277b
9ead96f
8821f01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from functools import cached_property | ||
from pathlib import Path | ||
from typing import TYPE_CHECKING, Optional | ||
|
||
from vyper import ast as vy_ast | ||
|
@@ -79,10 +80,10 @@ def abi_type(self) -> ABIType: | |
return ABI_Address() | ||
|
||
def __str__(self): | ||
return self._id | ||
return Path(self._id).stem | ||
|
||
def __repr__(self): | ||
return f"interface {self._id}" | ||
return f"interface {Path(self._id).stem}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we want to change the str implementation, but not repr -- repr should attempt to be injective back to interfaces There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i changed _pp_signature to use |
||
|
||
def _try_fold(self, node): | ||
if len(node.args) != 1: | ||
|
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.
what if the type is aliased? e.g.
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.
right, that would show the ierc20
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.
Do you want it to show the alias when calling
__str__
? Or in one of the two issues #4237 or #4237?