gh-107155: Fix help(lambda_func) when lambda_func has `__annotati…#107401
gh-107155: Fix help(lambda_func) when lambda_func has `__annotati…#107401serhiy-storchaka merged 12 commits intopython:mainfrom
help(lambda_func) when lambda_func has `__annotati…#107401Conversation
…notations__` with `return` key.
|
Thanks for your help @AA-Turner ! Is there anything else that needs to be done? Also, I think this kind of PR doesn't need a |
Here's how to think about whether a bugfix PR deserves a news entry: does the PR fix a bug that users have noticed? If so, users deserve to know about it being fixed, so it should have a news entry. If not, the PR should be closed, as users won't notice the change being made, which makes the PR have very limited value. In this case, a user reported the bug on the GitHub issue tracker, so at least one user will notice the change. As such, it definitely deserves a news entry :) |
|
I'd agree with Alex, this is visible to end-users (although very rare!). Something that outlines that A |
Misc/NEWS.d/next/Library/2023-08-02-01-17-32.gh-issue-107155.Mj1K9L.rst
Outdated
Show resolved
Hide resolved
|
After your words, I agree that this PR needs a I wrote some lines, please, check it. |
…j1K9L.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Misc/NEWS.d/next/Library/2023-08-02-01-17-32.gh-issue-107155.Mj1K9L.rst
Outdated
Show resolved
Hide resolved
|
Now I'm have resolved the merge conflict. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I do not like modification of the original object. It is not thread-safe. It does not work if __annotations__ is read-only. It does not restore {'return': None}.
Maybe just keep the parentheses if the lambda object has annotations? In any case this is not a valid Python syntax.
All of your points makes sense to me, thanks for them! I've made changes, please take a look at them :) Is it okay or we should change it? |
|
lambda with annotations can't be expressed in Python syntax anyway. At least it now has balanced parentheses and does not truncate words. |
|
Thanks @Eclips4 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
|
Sorry, @Eclips4 and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @Eclips4 and @serhiy-storchaka, I could not cleanly backport this to |
|
GH-115612 is a backport of this pull request to the 3.12 branch. |
…notation (pythonGH-107401) (cherry picked from commit b9a9e3d) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
|
GH-115613 is a backport of this pull request to the 3.11 branch. |
...ons__`
I cannot find any example with parenthesis in signature of lambda 😄 .
help()output oflambdawith manually set__annotations__is one char off #107155