_ffi.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:pyShadowsocks 作者: FTwOoO 项目源码 文件源码
def native(type_, value):
    if isinstance(value, type_):
        return value
    if sys.version_info < (3,) and type_ == int and isinstance(value, int_types):
        return value
    if isinstance(value, ctypes.Array) and value._type_ == ctypes.c_byte:
        return ctypes.string_at(ctypes.addressof(value), value._length_)
    return type_(value.value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号