Author eric.smith
Recipients eric.smith, gvanrossum, ned.deily, steven.daprano
Date 2018-02-25.18:01:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519581669.21.0.467229070634.issue32929@psf.upfronthosting.co.za>
In-reply-to
Content
if unsafe_hash:
        # If there's already a __hash__, raise TypeError, otherwise add __hash__.
        if has_explicit_hash:
            hash_action = 'exception'
        else:
            hash_action = 'add'
    else:
        # unsafe_hash is False (the default).
        if has_explicit_hash:
            # There's already a __hash__, don't overwrite it.
            hash_action = ''
        else:
            if eq and frozen:
                # It's frozen and we added __eq__, generate __hash__.
                hash_action = 'add'
            elif eq and not frozen:
                # It's not frozen but has __eq__, make it unhashable.
                #  This is the default if no params to @dataclass.
                hash_action = 'none'
            else:
                # There's no __eq__, use the base class __hash__.
                hash_action = ''
History
Date User Action Args
2018-02-25 18:01:09eric.smithsetrecipients: + eric.smith, gvanrossum, ned.deily, steven.daprano
2018-02-25 18:01:09eric.smithsetmessageid: <1519581669.21.0.467229070634.issue32929@psf.upfronthosting.co.za>
2018-02-25 18:01:09eric.smithlinkissue32929 messages
2018-02-25 18:01:09eric.smithcreate