第41683题 判断题
以下代码中,构造函数被调用的次数是1次。( )
class Test:
    init_count = 0

    def __init__(self):
        Test.init_count += 1
        print("T ", end="")

    def __copy__(self):
        print("(拷贝构造,不触发__init__)", end="")
        new_obj = Test.__new__(Test)
        return new_obj

if __name__ == "__main__":
    a = Test()
    import copy
    b = copy.copy(a)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析