def test_bound_instance_method(): # 객체 인스턴스를 직접 호출하여 접근하는 방법 # 인수로 self는 전달하지 않음 p = Point() p.set_x(10) p.set_y(20) p.draw()
def test_unbound_class_method(): # 클래스 객체를 통해 우회 접근 # self 인수에 객체의 참조 주소를 전달해야 함 p = Point() Point.set_x(p, 10) Point.set_y(p, 20) Point.draw(p)