[Python-3000] PEP 3100 Comments

Ronald Oussoren ronaldoussoren at mac.com
Mon May 8 11:46:33 CEST 2006


On 8-mei-2006, at 8:58, Talin wrote:
>
>> And *how* exactly would you implement your isFunction test
>> so as to detect the "naive, everyday concept of a function"
>> that you seem to want, in a way that does any better job
>> than the current callable()?
>
> This 'isFunction' test that I am thinking of would only return true  
> for
> user defined functions, built-in functions, and similar objects; It
> would not return true for classes or other objects that are  
> technically
> functions in a mathematically pure sense, but which normal people  
> don't
> think of as functions.
>
> In other words, a function that does what most people expect it to, by
> conforming to their intuitive idea of what a function is, rather than
> some grammatical or mathematical definition. And in cases of  
> ambiguity,
> it would be conservative, returning false negatives but not false  
> positives.

But why would this be useful? Using objects with a __call__ method as a
function is useful at times (such as with callback functions or to  
remember
state).

If isFunction would return false for such objects it is likely that such
objects would be rejected at some places where I'd like to use them.

Ronald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2157 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20060508/dd0125fd/attachment.bin 


More information about the Python-3000 mailing list