Checking default arguments
Igor V. Rafienko
igorr at ifi.uio.no
Mon Feb 5 21:09:34 EST 2007
[ George Sakkis ]
First of all, thanks to everyone who replied.
[ ... ]
> I don't know why you might want to distinguish between the two in
> practice (the unique object idea mentioned in other posts should
> handle most uses cases), but if you insist, here's one way to do it:
There is no actual code situation where it happens. I was simply
intrigued by the problem and could not find an answer.
Since {}.pop behaves this way, I checked the C code. Apparently, it
*is* quite easy from C, since PyArg_UnpackTuple and clever initial
values (NULL vs. Py_None) make all the difference.
The inspect-suggestion is, unfortunately, a bit more difficult to
comprehend than I initially hoped for :)
Thanks for all the suggestions
[ ... ]
ivr
--
"...but it's HDTV -- it's got a better resolution than the real world."
-- Fry, "When aliens attack"
More information about the Python-list
mailing list