Testing for presence of arguments
Peter Maas
peter at somewhere.com
Thu Aug 18 06:02:36 EDT 2005
Madhusudan Singh schrieb:
> Dan Sommers wrote:
[...]
>> class _SemiPrivateClass:
>> pass
>>
>> def f(required_argument=_SemiPrivateClass):
>> if required_argument == _SemiPrivateClass:
>> print "required_argument was probably not present"
>> else:
>> print "required_argument was present"
[...]
> Thanks for the suggestion, but seems needlessly complicated for
> something very simple.
What is "very simple"? The problem or the solution? :) If you examine
this suggestion more closely you will note that it is more or less
the same as Benji York's one except Benji used a built-in class.
If you are interested in getting help on usenet you should abstain
from devaluating efforts to give you a useful reply. "Thanks for
the suggestion" or even no answer would have been sufficient.
--
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------
More information about the Python-list
mailing list