[Python-checkins] CVS: python/dist/src/Modules _weakref.c,1.3,1.4

Fred L. Drake fdrake@users.sourceforge.net
Sat, 17 Feb 2001 21:20:20 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv22353

Modified Files:
	_weakref.c 
Log Message:

Move docstrings out of function table to constants defined near the
function implementations.


Index: _weakref.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** _weakref.c	2001/02/02 21:10:53	1.3
--- _weakref.c	2001/02/18 05:20:18	1.4
***************
*** 462,465 ****
--- 462,469 ----
  
  
+ static char weakref_getweakrefcount__doc__[] =
+ "getweakrefcount(object) -- return the number of weak references\n"
+ "to 'object'.";
+ 
  static PyObject *
  weakref_getweakrefcount(PyObject *self, PyObject *args)
***************
*** 481,484 ****
--- 485,492 ----
  
  
+ static char weakref_getweakrefs__doc__[] =
+ "getweakrefs(object) -- return a list of all weak reference objects\n"
+ "that point to 'object'.";
+ 
  static PyObject *
  weakref_getweakrefs(PyObject *self, PyObject *args)
***************
*** 562,565 ****
--- 570,578 ----
  
  
+ static char weakref_ref__doc__[] =
+ "new(object[, callback]) -- create a weak reference to 'object';\n"
+ "when 'object' is finalized, 'callback' will be called and passed\n"
+ "a reference to 'object'.";
+ 
  static PyObject *
  weakref_ref(PyObject *self, PyObject *args)
***************
*** 611,614 ****
--- 624,632 ----
  
  
+ static char weakref_proxy__doc__[] =
+ "proxy(object[, callback]) -- create a proxy object that weakly\n"
+ "references 'object'.  'callback', if given, is called with a\n"
+ "reference to the proxy when it is about to be finalized.";
+ 
  static PyObject *
  weakref_proxy(PyObject *self, PyObject *args)
***************
*** 712,728 ****
  weakref_functions[] =  {
      {"getweakrefcount", weakref_getweakrefcount,        METH_VARARGS,
!      "getweakrefcount(object) -- return the number of weak references\n"
!      "to 'object'."},
      {"getweakrefs",     weakref_getweakrefs,            METH_VARARGS,
!      "getweakrefs(object) -- return a list of all weak reference objects\n"
!      "that point to 'object'."},
!     {"proxy",           weakref_proxy,	                METH_VARARGS,
!      "proxy(object[, callback]) -- create a proxy object that weakly\n"
!      "references 'object'.  'callback', if given, is called with a\n"
!      "reference to 'object' when it is about to be finalized."},
      {"ref",             weakref_ref,                    METH_VARARGS,
!      "new(object[, callback]) -- create a weak reference to 'object';\n"
!      "when 'object' is finalized, 'callback' will be called and passed\n"
!      "a reference to 'object'."},
      {NULL, NULL, 0, NULL}
  };
--- 730,740 ----
  weakref_functions[] =  {
      {"getweakrefcount", weakref_getweakrefcount,        METH_VARARGS,
!      weakref_getweakrefcount__doc__},
      {"getweakrefs",     weakref_getweakrefs,            METH_VARARGS,
!      weakref_getweakrefs__doc__},
!     {"proxy",           weakref_proxy,                  METH_VARARGS,
!      weakref_proxy__doc__},
      {"ref",             weakref_ref,                    METH_VARARGS,
!      weakref_ref__doc__},
      {NULL, NULL, 0, NULL}
  };