Open jfine2358 opened 1 year ago
At present hash and pygit2.hash have the same repr. We can tell them apart by looking at the __module__ attribute. But not their type.
hash
pygit2.hash
__module__
type
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pygit2 >>> hash, pygit2.hash (<built-in function hash>, <built-in function hash>) >>> id(hash) - id(pygit2.hash) 2918112 >>> pygit2.hash.__module__ 'pygit2._pygit2' >>> hash.__module__ 'builtins' >>> type(hash), type(pygit2.hash) (<class 'builtin_function_or_method'>, <class 'builtin_function_or_method'>) >>>
This will confuse anyone who relies on repr to check that they are using the correct hash function.
repr
At present
hash
andpygit2.hash
have the same repr. We can tell them apart by looking at the__module__
attribute. But not theirtype
.This will confuse anyone who relies on
repr
to check that they are using the correcthash
function.