Oops I did make a mistake. The code I wanted to test should have been import copy print 'Test 1' pf= '?,?,?,?' sqlx1= 'INSERT INTO DTABLE2 VALUES ( %s ) ' % pf print sqlx1
print print 'Test 2' sqlx2= copy.copy(sqlx1) sqlx3= sqlx1 pf= '?,?,?, ****' print 'sqlx1= ', sqlx1 print 'sqlx2= ', sqlx2 print 'sqlx3= ', sqlx2 and the results would == output Test group 1 INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) Test group 2 sqlx1= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) sqlx2= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) sqlx3= INSERT INTO DTABLE2 VALUES ( ?,?,?,? ) Such that sqlx1 does to change with the re-assignment of 'pf' And of course immutables such as strings are immutable. Got it now. -- http://mail.python.org/mailman/listinfo/python-list