[Python-Dev] Remove METH_OLDARGS?

Scott Dial scott+python-dev at scottdial.com
Tue May 30 18:03:48 CEST 2006


Neal Norwitz wrote:
> Already done for gcc, see Py_DEPRECATED in pyport.h.  Would be nice if
> someone could add support on Windows.
> 

The manner that macro is used can't be leveraged to work in the VC 
compiler. I admit to not having done an extensive search for the usage 
of Py_DEPRECATED, but to take from object.h:

typedef PyObject *(*intargfunc)(PyObject *, int) Py_DEPRECATED(2.5);

In GCC, you tag on __attribute__((__deprecated__)) but there is no 
equivalent tagging method in VC. In VC, you should instead put a pragma 
for the identifier: #pragma deprecated(intargfunc). AFAIK, you can't put 
a #pragma in a #define, so it seems wise to only mark functions 
deprecated (which you can do via __declspec(deprecated)).

-- 
Scott Dial
scott at scottdial.com
scodial at indiana.edu


More information about the Python-Dev mailing list