약한 참조 객체
**************

파이썬은 *약한 참조*를 1급 객체로 지원합니다. 약한 참조를 직접 구현하
는 두 가지 구체적인 객체 형이 있습니다. 첫 번째는 간단한 참조 객체이며
, 두 번째는 가능한 한 원래 객체의 프락시 역할을 합니다.

int PyWeakref_Check(ob)

   *ob*가 참조 객체나 프락시 객체면 참을 반환합니다.

int PyWeakref_CheckRef(ob)

   *ob*가 참조 객체면 참을 반환합니다.

int PyWeakref_CheckProxy(ob)

   *ob*가 프락시 객체면 참을 반환합니다.

PyObject* PyWeakref_NewRef(PyObject *ob, PyObject *callback)
    *Return value: New reference.*

   Return a weak reference object for the object *ob*.  This will
   always return a new reference, but is not guaranteed to create a
   new object; an existing reference object may be returned.  The
   second parameter, *callback*, can be a callable object that
   receives notification when *ob* is garbage collected; it should
   accept a single parameter, which will be the weak reference object
   itself. *callback* may also be "None" or "NULL".  If *ob* is not a
   weakly-referencable object, or if *callback* is not callable,
   "None", or "NULL", this will return "NULL" and raise "TypeError".

PyObject* PyWeakref_NewProxy(PyObject *ob, PyObject *callback)
    *Return value: New reference.*

   Return a weak reference proxy object for the object *ob*.  This
   will always return a new reference, but is not guaranteed to create
   a new object; an existing proxy object may be returned.  The second
   parameter, *callback*, can be a callable object that receives
   notification when *ob* is garbage collected; it should accept a
   single parameter, which will be the weak reference object itself.
   *callback* may also be "None" or "NULL".  If *ob* is not a weakly-
   referencable object, or if *callback* is not callable, "None", or
   "NULL", this will return "NULL" and raise "TypeError".

PyObject* PyWeakref_GetObject(PyObject *ref)
    *Return value: Borrowed reference.*

   약한 참조(*ref*)로부터 참조된 객체를 반환합니다. 참조가 더는 살아있
   지 않으면, "Py_None"을 반환합니다.

   참고:

     이 함수는 참조된 객체에 대한 **빌린 참조**를 반환합니다. 이는 객
     체를 계속 사용하는 동안 객체가 파괴될 수 없음을 알고 있을 때를 제
     외하고, 객체에 대해 항상 "Py_INCREF()"를 호출해야 함을 뜻합니다.

PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
    *Return value: Borrowed reference.*

   "PyWeakref_GetObject()"와 유사하지만, 에러 검사를 수행하지 않는 매
   크로로 구현됩니다.
