Larry Bates wrote:
Michel Claveau wrote:

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

...
If you have a tuple and want to return it, just return it:  return vret

If you want to wrap objects in a tuple to return it, I would recommend using the build in tuple() command as the parenthesis can be confusing: return tuple(111,222,333).

The reason return (vret,) works is because it is the same as: return tuple(tuple(111,222,333) (the trailing comma is the key here and is what tells python you mean a tuple instead of the "normal" parenthesis meaning.

May seem inconsistent, but I don't believe it really is.

Well, regardless of his typos, there is clearly at least ONE inconsistency here, in that returning a tuple behaves differently in the COM and non-COM cases. Returning a scalar or a list works the same in both cases.

I don't know whether that's a well-documented side effect of some other process, or if it is a bug, but it is inconsistent.

--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

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

Reply via email to