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 overload_method problem with stararg #4978
Conversation
internal CI: |
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.
Thanks for the patch, I've tried it locally and it seems good. Whilst this is small it must have taken ages to work this out, good job! One minor comment to resolve else good to go.
class StarArgTuple(Tuple): | ||
"""To distinguish from Tuple() used as argument to a `*args`. | ||
""" | ||
def __new__(cls, types): | ||
_HeterogeneousTuple.is_types_iterable(types) | ||
|
||
if types and all(t == types[0] for t in types[1:]): | ||
return StarArgUniTuple(dtype=types[0], count=len(types)) | ||
else: | ||
return object.__new__(StarArgTuple) | ||
|
||
|
||
class StarArgUniTuple(UniTuple): | ||
"""To distinguish from UniTuple() used as argument to a `*args`. | ||
""" |
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.
Should these get a custom name
written to self.name
so as to distinguish the type in traceback/debug?
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.
good catch. yes it needs new name
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.
fixed in 90956ff
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.
Thanks for the fix up.
Think this is waiting on CI now. |
internal CI passed |
Fix #4944
*args
tuple*args
versus tuple created by it.