当前位置: 首页>>代码示例>>Python>>正文


Python _testcapi.SIZEOF_PYGC_HEAD属性代码示例

本文整理汇总了Python中_testcapi.SIZEOF_PYGC_HEAD属性的典型用法代码示例。如果您正苦于以下问题:Python _testcapi.SIZEOF_PYGC_HEAD属性的具体用法?Python _testcapi.SIZEOF_PYGC_HEAD怎么用?Python _testcapi.SIZEOF_PYGC_HEAD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在_testcapi的用法示例。


在下文中一共展示了_testcapi.SIZEOF_PYGC_HEAD属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_sizeof

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def check_sizeof(test, o, size):
    result = sys.getsizeof(o)
    # add GC header size
    if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
        ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
        size += _testcapi.SIZEOF_PYGC_HEAD
    msg = 'wrong size for %s: got %d, expected %d' \
            % (type(o), result, size)
    test.assertEqual(result, size, msg)

#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards. 
开发者ID:war-and-code,项目名称:jawfish,代码行数:15,代码来源:support.py

示例2: check_sizeof

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def check_sizeof(test, o, size):
    import _testcapi
    result = sys.getsizeof(o)
    # add GC header size
    if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
        ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
        size += _testcapi.SIZEOF_PYGC_HEAD
    msg = 'wrong size for %s: got %d, expected %d' \
            % (type(o), result, size)
    test.assertEqual(result, size, msg)


#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards. 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:17,代码来源:__init__.py

示例3: check_sizeof

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def check_sizeof(test, o, size):
    result = sys.getsizeof(o)
    # add GC header size
    if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
        ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
        size += _testcapi.SIZEOF_PYGC_HEAD
    msg = 'wrong size for %s: got %d, expected %d' \
            % (type(o), result, size)
    test.assertEqual(result, size, msg)


#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards. 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:16,代码来源:test_support.py

示例4: setUp

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def setUp(self):
        self.P = struct.calcsize('P')
        self.longdigit = sys.long_info.sizeof_digit
        import _testcapi
        self.gc_headsize = _testcapi.SIZEOF_PYGC_HEAD
        self.file = open(test.test_support.TESTFN, 'wb') 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:8,代码来源:test_sys.py

示例5: setUp

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def setUp(self):
        self.P = struct.calcsize('P')
        self.longdigit = sys.int_info.sizeof_digit
        import _testcapi
        self.gc_headsize = _testcapi.SIZEOF_PYGC_HEAD
        self.file = open(test.support.TESTFN, 'wb') 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:8,代码来源:test_sys.py

示例6: check_sizeof

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def check_sizeof(test, o, size):
    import _testcapi
    result = sys.getsizeof(o)
    # add GC header size
    if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
        ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
        size += _testcapi.SIZEOF_PYGC_HEAD
    msg = 'wrong size for %s: got %d, expected %d' \
            % (type(o), result, size)
    test.assertEqual(result, size, msg)

#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards. 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:16,代码来源:__init__.py

示例7: check_sizeof

# 需要导入模块: import _testcapi [as 别名]
# 或者: from _testcapi import SIZEOF_PYGC_HEAD [as 别名]
def check_sizeof(test, o, size):
    result = sys.getsizeof(o)
    # add GC header size
    if (_testcapi and\
        (type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\
        ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))):
        size += _testcapi.SIZEOF_PYGC_HEAD
    msg = 'wrong size for %s: got %d, expected %d' \
            % (type(o), result, size)
    test.assertEqual(result, size, msg)


#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards. 
开发者ID:Acmesec,项目名称:CTFCrackTools-V2,代码行数:17,代码来源:test_support.py


注:本文中的_testcapi.SIZEOF_PYGC_HEAD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。