gh-80762: Fix dir() on MagicMock with tuple specs - #12753
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
c292b21 to
e6878dd
Compare
|
@dsem this PR needs update. |
|
@brettcannon I can't change the CLA label and the CLA has been signed (checked on bpo). |
|
@dsem There is a problem with your commit, you have used another user for your commit. You have committed with Also,
Thank you |
d6ad8f9 to
95aefc1
Compare
|
Nice find about me using the wrong username. I believe I've addressed all the issues now. Thanks! |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
| # checks for list, tuples, or sets | ||
| # XXXX badly named! | ||
| return type(obj) in (list, tuple) | ||
| return type(obj) in (list, tuple, set) |
There was a problem hiding this comment.
This change is unrelated to the original issue, and it is also breaking -- changes user visible behavior for spec=set(). If you need this change, open a new issue with separate discussion.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Accepting sets in _is_list() would change the meaning of a set *spec* from mirroring a set object to a list of attribute names, and affect also __class__, isinstance() and create_autospec(). A tuple *spec* has been supported since the initial import and is used in tests, but it was never documented. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A tuple *spec* worked before, except in dir(), so this is a fix, not a new feature. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Documentation build overview
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Updated documentation. Tuple of string is now officially supported. LGTM now.
https://bugs.python.org/issue36581