Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 30, 2018

if (!exprstr) {
return 0;
}
name = PyUnicode_FromFormat("<%U>", exprstr);
Copy link
Member

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] + ' ...'

Copy link
Member

@iritkatriel iritkatriel left a 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.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@hauntsaninja hauntsaninja changed the title bpo-34856: Make the repr of lambda containing the signature and body expression. gh-79037: Make the repr of lambda containing the signature and body expression. Feb 9, 2023
Copy link
Contributor

@furkanonder furkanonder left a 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
Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes stale Stale PR or inactive for long period of time. type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants