-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-79037: Make the repr of lambda containing the signature and body expression. #9647
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
base: main
Are you sure you want to change the base?
Conversation
if (!exprstr) { | ||
return 0; | ||
} | ||
name = PyUnicode_FromFormat("<%U>", exprstr); |
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.
Before this, add C equivalent of, say,
if len(exprstr) > 36: exprstr = exprstr[0:36] + ' ...'
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 has merge conflicts now.
When you're done making the requested changes, leave the comment: |
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.
LGTM. It would be extremely beneficial for Lambda's repr to include the signature and body, particularly for debugging. @serhiy-storchaka Could you resolve the conflicts?
@@ -107,6 +107,18 @@ Other Language Changes | |||
and :keyword:`return` statements. | |||
(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.) | |||
|
|||
* The repr and the name of :keyword:`lambda` functions will now contain |
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.
The whatsnew entry must be added to the current main file, not the 3.8 file.
@@ -0,0 +1 @@ | |||
The repr of lambda now contains the signature and body expression. |
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.
The repr of lambda now contains the signature and body expression. | |
Add signature and body expression to the repr of lambda. |
I think that this would also be a better PR title.
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue34856