Issue39559
Created on 2020-02-05 12:02 by srittau, last changed 2020-02-05 20:45 by serhiy.storchaka. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 18369 | merged | hauntsaninja, 2020-02-05 18:26 | |
| Messages (7) | |||
|---|---|---|---|
| msg361423 - (view) | Author: Sebastian Rittau (srittau) * | Date: 2020-02-05 12:02 | |
uuid.getnode() has an undocumented, keyword-only "getters" argument that gets discarded immediately. This is confusing when using code inspection tools and can give the wrong impression that you can somehow override the node getters when you can't. I recommend removing this argument. |
|||
| msg361424 - (view) | Author: Sebastian Rittau (srittau) * | Date: 2020-02-05 12:05 | |
Shantanu points out in https://github.com/python/typeshed/pull/3715 that the argument was made useless due to bpo-28009. |
|||
| msg361447 - (view) | Author: Tal Einat (taleinat) * | Date: 2020-02-05 18:31 | |
Simply removing the argument would be backwards-incompatible. Unless someone can show via a code search that this is never used in practice, we may want to consider deprecating this argument before removing it. |
|||
| msg361448 - (view) | Author: Shantanu (hauntsaninja) * | Date: 2020-02-05 19:07 | |
Github code search isn't great, but I was unable to find any usage of `uuid.getnode(getters=`, whereas I was able to find usage of `uuid.uuid1(node=` (even though `node` is optional and can be passed positionally). I'd be surprised if it was used in practice, given that it's undocumented and only present on 3.7+ (I discovered it while running `inspect.signature` on large parts of stdlib). I think that, and the fact that this never did anything (even before bpo-28009 it looks like `getters` gets immediately overwritten), mitigate the risk here. Let me know what you think should be done; happy to submit a PR that issues a deprecation warning. |
|||
| msg361449 - (view) | Author: Sebastian Rittau (srittau) * | Date: 2020-02-05 20:00 | |
Code using this argument is in all likelihood already subtly broken, because it depends on non-existing functionality. I believe that a "hard" break would be better (for Python 3.9). |
|||
| msg361452 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2020-02-05 20:43 | |
New changeset 8b6f6526f857bb7523b0fcff09b45bc6471289e9 by Shantanu in branch 'master': bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369) https://github.com/python/cpython/commit/8b6f6526f857bb7523b0fcff09b45bc6471289e9 |
|||
| msg361453 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2020-02-05 20:45 | |
I agree. It was added in issue32502, but was never documented and used. Thank you Sebastian and Shantanu. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-02-05 20:45:34 | serhiy.storchaka | set | status: open -> closed resolution: fixed messages: + msg361453 stage: patch review -> resolved |
| 2020-02-05 20:43:18 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg361452 |
| 2020-02-05 20:00:11 | srittau | set | messages: + msg361449 |
| 2020-02-05 19:07:35 | hauntsaninja | set | nosy:
+ hauntsaninja messages: + msg361448 |
| 2020-02-05 18:31:43 | taleinat | set | nosy:
+ taleinat messages:
+ msg361447 |
| 2020-02-05 18:26:40 | hauntsaninja | set | keywords:
+ patch stage: patch review pull_requests: + pull_request17743 |
| 2020-02-05 12:05:35 | srittau | set | messages: + msg361424 |
| 2020-02-05 12:02:55 | srittau | create | |