一个对象要能用于 with 语句,必须实现的方法是?

Python

  1. A.__iter__ 与 __next__(迭代器协议)
  2. B.__get__ 与 __set__
  3. C.__enter__ 与 __exit__
  4. D.__call__(可调用协议)