[Python-3000] PEP 3100 Comments
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun May 7 13:47:28 CEST 2006
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).
This isn't so bad, because it's pretty rare for
someone to try to create a "string-like" object that
isn't a subclass of str. But callable objects can
be of any class, and such objects are frequently
used.
--
Greg
More information about the Python-3000
mailing list