Python types 模块,h() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用types.h()

项目:dbussy    作者:ldo    | 项目源码 | 文件源码
def data_key(data) :
    "returns a unique value that allows data to be used as a dict/set key."
    if isinstance(data, (bytes, float, frozenset, int, str, tuple)) :
        result = data
    else :
        # data itself is non-hashable
        result = id(data)
    #end if
    return \
        result
#end data_key

#+
# Library prototypes
#-

# from dbus-connection.h: