On 5/7/06, Talin <[EMAIL PROTECTED]> wrote:
All right, I'll desist.

[insert distinct sound of persistance] 

How about instead of 'callable', an "isFunction' test to go along
with 'isSequence' and 'isMapping'. (You aren't getting rid of those -
I hope...?)

He is, and for the same reasons as callable(): there is no way to tell whether an object is a mapping or a sequence (considering Python object of both 'types' implement __getitem__, and that's it. If you don't believe me, ask isSequence about UserDict.). You can guess, but guessing is not what Python should do. If you want to make your library guess, feel free (and document it), but it has no place in language specifics.

(On the other hand, it looks like Guido will put in a form of adaptation or generics, which would solve *both* your problems.)

Yet, I feel like in this case I'm being told that my testing of the
type of an object is "bad style" because it's non-OOP. While there
may be valid criticisms of this technique, this particular criticism
seems falsely reductionist.

It's bad style has nothing to do with OOP, but with ducktyping (which is unrelated to OOP as such.) Python is deeply invested in ducktyping, and it isn't going to change. At best, there will be (optional) adaptation/genericity, which is more or less a formalized ducktyping.

I'm not sure that I buy the 'time to learn and explain' argument.
If we take that to its logical extreme, then we should be
using Lisp, since there's only a single syntactical constructs to
learn and explain.

'print' itself is a logical extremity in the other direction, and it proved its own disservitude in that regard. It's not the vanguard of an assault at Python's grammar.

--
Thomas Wouters <[EMAIL PROTECTED]>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to