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

fix hashing #32427

Closed
tmick mannequin opened this issue Jun 6, 2000 · 8 comments
Closed

fix hashing #32427

tmick mannequin opened this issue Jun 6, 2000 · 8 comments
Assignees

Comments

@tmick
Copy link
Mannequin

tmick mannequin commented Jun 6, 2000

BPO 400503
Nosy @gvanrossum, @tim-one, @freddrake
Files
  • None: None
  • 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 = 'https://github.com/freddrake'
    closed_at = <Date 2000-06-29.19:20:34.000>
    created_at = <Date 2000-06-06.02:40:44.000>
    labels = []
    title = 'fix hashing'
    updated_at = <Date 2000-06-29.19:20:34.000>
    user = 'https://bugs.python.org/tmick'

    bugs.python.org fields:

    activity = <Date 2000-06-29.19:20:34.000>
    actor = 'fdrake'
    assignee = 'fdrake'
    closed = True
    closed_date = None
    closer = None
    components = ['None']
    creation = <Date 2000-06-06.02:40:44.000>
    creator = 'tmick'
    dependencies = []
    files = ['2435']
    hgrepos = []
    issue_num = 400503
    keywords = ['patch']
    message_count = 8.0
    messages = ['32676', '32677', '32678', '32679', '32680', '32681', '32682', '32683']
    nosy_count = 4.0
    nosy_names = ['gvanrossum', 'tim.peters', 'fdrake', 'tmick']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue400503'
    versions = []

    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 6, 2000

    No description provided.

    @tmick tmick mannequin closed this as completed Jun 6, 2000
    @tmick tmick mannequin assigned freddrake Jun 6, 2000
    @tmick tmick mannequin closed this as completed Jun 6, 2000
    @tmick tmick mannequin assigned freddrake Jun 6, 2000
    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 6, 2000

    This patch addresses two main issues:
    (1) There exist some non-fatal errors in some of the hash algorithms. For
    exmaple, in float_hash and complex_hash a certain part of the value is
    not included in the hash calculation. See Tim's, Guido's, and my
    discussion of this on python-dev in May under the title
    "fix float_hash and complex_hash for 64-bit *nix"

    (2) The hash algorithms that use pointers (e.g. func_hash, code_hash) are
    universally not correct on Win64 (they assume that sizeof(long) ==
    sizeof(void*))

    As well, this patch significantly cleans up the hash code. It adds the two
    function _Py_HashDouble and _PyHash_VoidPtr that the various hashing routine
    are changed to use.

    These help maintain the hash function invariant:
    (a==b) => (hash(a)==hash(b)))
    I have added Lib/test/test_hash.py and Lib/test/output/test_hash to test this
    for some cases.

    @tmick
    Copy link
    Mannequin Author

    tmick mannequin commented Jun 6, 2000

    I confirm that, to the best of my knowledge and belief, this
    contribution is free of any claims of third parties under
    copyright, patent or other rights or interests ("claims"). To
    the extent that I have any such claims, I hereby grant to CNRI a
    nonexclusive, irrevocable, royalty-free, worldwide license to
    reproduce, distribute, perform and/or display publicly, prepare
    derivative versions, and otherwise use this contribution as part
    of the Python software and its related documentation, or any
    derivative versions thereof, at no cost to CNRI or its licensed
    users, and to authorize others to do so.

    I acknowledge that CNRI may, at its sole discretion, decide
    whether or not to incorporate this contribution in the Python
    software and its related documentation. I further grant CNRI
    permission to use my name and other identifying information
    provided to CNRI by me for use in connection with the Python
    software and its related documentation.

    @gvanrossum
    Copy link
    Member

    just testing the SF patch manager

    @gvanrossum
    Copy link
    Member

    Tim, please review! Then assign to Trent if it's OK to commit.

    @tim-one
    Copy link
    Member

    tim-one commented Jun 27, 2000

    Changed to Accepted, assigned back to Trent for commit.

    Looks good, Trent! My only gripe is about the hash function for complex numbers (because it's symmetric), but that problem existed before and you haven't made it any worse. Ship it (I'll improve the complex hash later).

    1 similar comment
    @tim-one
    Copy link
    Member

    tim-one commented Jun 27, 2000

    Changed to Accepted, assigned back to Trent for commit.

    Looks good, Trent! My only gripe is about the hash function for complex numbers (because it's symmetric), but that problem existed before and you haven't made it any worse. Ship it (I'll improve the complex hash later).

    @freddrake
    Copy link
    Member

    Applied verbatim; patch to PC/winreg.c applied to PC/_winreg.c due to name change.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants