Skip to content
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

uuid.getnode() has unused argument #83740

Closed
srittau mannequin opened this issue Feb 5, 2020 · 7 comments
Closed

uuid.getnode() has unused argument #83740

srittau mannequin opened this issue Feb 5, 2020 · 7 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@srittau
Copy link
Mannequin

srittau mannequin commented Feb 5, 2020

BPO 39559
Nosy @srittau, @taleinat, @serhiy-storchaka, @hauntsaninja
PRs
  • bpo-39559: Remove unused, undocumented argument from uuid.getnode #18369
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-02-05.20:45:34.885>
    created_at = <Date 2020-02-05.12:02:55.631>
    labels = ['library', '3.9']
    title = 'uuid.getnode() has unused argument'
    updated_at = <Date 2020-02-05.20:45:34.884>
    user = 'https://github.com/srittau'

    bugs.python.org fields:

    activity = <Date 2020-02-05.20:45:34.884>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-02-05.20:45:34.885>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2020-02-05.12:02:55.631>
    creator = 'srittau'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39559
    keywords = ['patch']
    message_count = 7.0
    messages = ['361423', '361424', '361447', '361448', '361449', '361452', '361453']
    nosy_count = 4.0
    nosy_names = ['srittau', 'taleinat', 'serhiy.storchaka', 'hauntsaninja']
    pr_nums = ['18369']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39559'
    versions = ['Python 3.9']

    @srittau
    Copy link
    Mannequin Author

    srittau mannequin commented Feb 5, 2020

    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.

    @srittau srittau mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir labels Feb 5, 2020
    @srittau
    Copy link
    Mannequin Author

    srittau mannequin commented Feb 5, 2020

    Shantanu points out in python/typeshed#3715 that the argument was made useless due to bpo-28009.

    @taleinat
    Copy link
    Contributor

    taleinat commented Feb 5, 2020

    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.

    @taleinat taleinat added 3.9 only security fixes and removed 3.7 (EOL) end of life labels Feb 5, 2020
    @hauntsaninja
    Copy link
    Contributor

    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.

    @srittau
    Copy link
    Mannequin Author

    srittau mannequin commented Feb 5, 2020

    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).

    @serhiy-storchaka
    Copy link
    Member

    New changeset 8b6f652 by Shantanu in branch 'master':
    bpo-39559: Remove unused, undocumented argument from uuid.getnode (GH-18369)
    8b6f652

    @serhiy-storchaka
    Copy link
    Member

    I agree. It was added in bpo-32502, but was never documented and used.

    Thank you Sebastian and Shantanu.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants