Greg Ewing wrote:
> Talin wrote:
>
>> (Admittedly this particular case could be done without 'callable', since you
>> could test for string type, and assume callable otherwise.
>
> Yes, and that's exactly why it can be made to work
> in this particular case. Most likely no testing for
> callability is being done, only isinstance(repl, str).
Use the source, Luke:
if (PyCallable_Check(ptemplate)) {
/* sub/subn takes either a function or a template */
filter = ptemplate;
Py_INCREF(filter);
filter_is_callable = 1;
[...]
Georg
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com