Skip to content

Fix property.__set_name__ error message when arguments are invalid#4165

Merged
youknowone merged 3 commits into
RustPython:mainfrom
jopemachine:fix-test-prop
Feb 23, 2023
Merged

Fix property.__set_name__ error message when arguments are invalid#4165
youknowone merged 3 commits into
RustPython:mainfrom
jopemachine:fix-test-prop

Conversation

@jopemachine
Copy link
Copy Markdown
Contributor

No description provided.

@jopemachine jopemachine force-pushed the fix-test-prop branch 3 times, most recently from 6035a80 to 2994e3f Compare September 17, 2022 05:08
@youknowone youknowone added the z-ca-2022 Tag to track contrubution-academy 2022 label Sep 17, 2022
Comment on lines +165 to +136
format!(
"__set_name__() takes 2 positional arguments but {} were given",
arg_len
),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This message is common python type error which we are not handling well. We'd better to find enhance the general argument error handling instead of this way.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am sorry, the given type is PosArgs. So no way to do it in shared code.

@youknowone
Copy link
Copy Markdown
Member

@jopemachine is it still a draft or done?

@DimitrisJim
Copy link
Copy Markdown
Member

this seems like its good to go, no?

@youknowone youknowone marked this pull request as ready for review February 23, 2023 09:07
@youknowone youknowone merged commit 48254ac into RustPython:main Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

z-ca-2022 Tag to track contrubution-academy 2022

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants