forbiddenfruit icon indicating copy to clipboard operation
forbiddenfruit copied to clipboard

Added support for __hash__

Open rigGitLikeYouDigGit opened this issue 3 years ago • 0 comments

Tiny change to override_dict to allow overriding __hash__(self) magic method

Can be verified by running following code:

import forbiddenfruit
hashLambda = lambda obj: id(obj)
forbiddenfruit.curse(set, "__hash__", hashLambda)

baseSet = {"a", "b"}
outerSet = {baseSet, 24} # set now contains another set object, using its id in memory as its hash

rigGitLikeYouDigGit avatar Aug 28 '22 15:08 rigGitLikeYouDigGit