题库首页 › GESP等级认证(Python) › 题目 20712

以下代码中,构造函数被调用的次数是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)

A. 正确
B. 错误

正确答案:正确

试卷来源:202512 CCF-GESP编程能力等级认证Python六级真题

本卷相关题目

在线做题 同科目题库