write() should accept both int/long and tuple/list