Hi!

Not a question. Only a little note...  (for readers without Sunday activity)


In (pure) Python, consider this code:
   def ftest():
       vret=(111,222,333)
       return(vret)

   print ftest()     #give:  (111, 222, 333)


In (COM) Python, the same method of the class of a dynamic-COM-server give other return:
   def ftest():
       vret=(111,222,333)
       return(vret)

   pv = win32com.client.Dispatch('.......
   print pv.ftest()     #give:  111



In (pure) Python, this code:
   def ftest():
       vret=(111,222,333)
       return(vret,)   #note the comma!

   print ftest()     #give:  ((111, 222, 333),)


In (COM) Python, the same method of the class of a dynamic-COM-server give other return:
   def ftest():
       vret=(111,222,333)
       return(vret,)  #note the comma!

   pv = win32com.client.Dispatch('.......
   print pv.ftest()     #give:  (111, 222, 333)


Another detail:
   def ftest():
       vret=[111,222,333]  #list in the place of tuple
       return(vret)

   pv = win32com.client.Dispatch('.......
   print pv.ftest()     #give:  (111, 222, 333)


And, to finish: in COM,  return(vret) & return(vret,)  give the same result.



I wish you marvellous Sunday, with sun, bathe and aperitif.
--
Michel Claveau






_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to