[XML-SIG] setAttribute DOM question-newbie

Fred L. Drake, Jr. fdrake@acm.org
Thu, 15 Nov 2001 10:50:30 -0500


Thomas B. Passin writes:
 > >             if type(s) != type(""):
 > >                 s = `s`
 > 
 > I would have used
 >      s=str(row[i])
 > 
 > A bit simpler...

  Simpler, but the semantics are different.  A cleaner approach might
be:

	if not isinstance(s, StringType):
	    s = `s`


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation