Hey, that's good. Thanks Steve. Hadn't seen it before. One to use.
Funny that Pythonwin's argument-prompter (or whatever that feature is
called) doesn't seem to like it.
E.g. if I have
def f(tupl):
print tupl
Then at the Pythonwin prompt when I type
f(
I correctly get "(tupl)" in the argument list pop-up box.
But if I have
def f((a, b)):
print a, b
then when I type
f(
I just get "(.0)" in the argument list pop-up box.
Or with
def f(p, q, (a, b)):
pass
Pythonwin prompts with
"(p, q, .4)"
However in each case the help() function correctly lists all the
arguments. Strange. I'll check if it's a known "feature".
That sounds like a bug in pythonwin autocomplete. Tuple unpacking in
function arguments is definitely a known feature, there were some
recent (fairly extensive) clp threads about it.[1]
I wish people would use it more, I think it's an awesome feature when
properly used. I like it especially for signatures like "def
change_coord((x, y))". It was one of those features, for me, where I
just tried it without knowing of its existence, assuming it would
work, and I was pleasantly surprised that it did.
Peace
Bill Mill
bill.mill at gmail.com
[1]
http://tinyurl.com/89zar
I think there was another about ways to improve tuple unpacking, but I
didn't find it in a brief search.
This is with
"PythonWin 2.4 (#60, Feb 9 2005, 19:03:27) [MSC v.1310 32 bit (Intel)]
on win32."