[XML-SIG] Python versions supported by PyXML?

M.-A. Lemburg mal@lemburg.com
Sat, 16 Feb 2002 14:15:55 +0100


"Martin v. Loewis" wrote:
> 
> "M.-A. Lemburg" <mal@lemburg.com> writes:
> 
> > Why not make PyOS_snprintf() a macro pointing to snprintf()
> > or even sprintf() for older Python versions ?
> 
> It is a macro for snprintf, but Fred thinks this is a hack, and I agree.
> Making it a macro for sprintf would be even more of a hack.
> 
> I don't see the rationale for using snprintf in the single place that
> uses it, and I think it makes the code clearer if the change to use
> PyOS_snprintf is reverted.

By making it a macro if PyXML you get the upward compatibility
for free. 

In Python 2.2 the code will then use the safe
PyOS_snprintf() while in other versions, it'll use
snprintf() or sprintf() (note that snprintf() is not
available on all platforms).

OTOH, since you only have a single occurrence, a simple
#ifdef would also do the trick. I thought it was used
more than that...

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/