question: parameters for create_polygon() method
Michael Hudson
mwh at python.net
Thu May 6 06:39:15 EDT 2004
Andrew Bennetts <andrew-pythonlist at puzzling.org> writes:
> Odd, though -- I thought that calls that put non-keyword args after keyword
> args were a syntax error, but using varargs syntax seems to workaround that
> -- e.g. try:
> canvas.create_polygon(fill="blue", (20, 20), (50, 150), (200, 50))
>
> Or without Tk:
>
> >>> def f(*args, **kw): print args, kw
> ...
> >>> f(x=1, 2)
> SyntaxError: non-keyword arg after keyword arg
> >>> f(x=1, *[2])
> (2,) {'x': 1}
>
> Interesting.
And even documented in all its tortuosity:
http://docs.python.org/ref/calls.html
(I know, I wrote that bit...)
Cheers,
mwh
--
Well, yes. I don't think I'd put something like "penchant for anal
play" and "able to wield a buttplug" in a CV unless it was relevant
to the gig being applied for...
-- Matt McLeod, alt.sysadmin.recovery
More information about the Python-list
mailing list