GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-40464: fix return annotation being used as the arg annotation in singledispatch by FFY00 · Pull Request #19871 · python/cpython Conversation
|
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
adff4b2 to
5f0a324
Compare
|
@rhettinger next, when we call |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Friendly ping, it has been 5 months. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@FFY00, have you considered using the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@taleinat thanks for the attention! I have, as pointed out in bpo. The issue is getting the correct first argument. This decorator operates before the method is registered in the class, so we don't know if we should skip the first argument ( This PR only fixes the issue of return annotation being used in the dispatch signature, it only mitigates the main problem. I am not sure how to properly address the root issue here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
To my understanding, we have separate Have you tried this with
We really should solve the root issue. I don't think avoiding only using the return annotation, while still possibly using the annotation for another argument, is a reasonable fix, unless we've made a significant attempt at a thorough fix and have come to the conclusion that it would be unreasonably hard to do, or that it would break backwards-compatibility too harshly. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Thank you for working on this, and sorry for the great delay in giving this any attention! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ah, sorry. I forgot about this 🙃 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…singledispatch Signed-off-by: Filipe Laíns <[email protected]>
Signed-off-by: Filipe Laíns <[email protected]>
|
To solve this issue I added a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Friendly ping. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
just an extra comment: Unfortunately, we can't rely on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| import inspect | ||
| try: | ||
| args = list(inspect.signature(cls).parameters.keys()) | ||
| except TypeError: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
signature() can also raise a ValueError if no signature can be provided.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
My apologies, @FFY00, I simply haven't been able to find the time to follow this up. @ambv, could you perhaps take a look at this? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I synchronized the branch with main, but it seems that this solution is not compatible with other features added in recent years, so some existing tests now fail. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing in face of that. I'll leave it for someone else to take up. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It doesn't: #130827 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.