On 7/21/07, Joe Smith <[EMAIL PROTECTED]> wrote:
> One of the nice features of Eby's proposal is that more complicated
> dispatching systems can be added. Perhaps some application needs a
> dispatching engine that can dispatch based on the value of an objects
> member. Perhaps the user wants an overload specificly for any product object
> whose price property equals 0. With Eby's system adding a dispatch engine
> that supports that is not difficult.

This is true. However it comes at a cost. Whenever I see an API that
takes a string which is then parsed by the called function as a Python
expression (perhaps constrained to a subset of Python) I cringe,
especially if the common use is to pass a literal. There are just so
many issues with that... It's not colorized by the editor, it's not
syntax-checked by either the editor or the Python parser, it requires
one to build yet another parser...

This is why I don't like the ...when("isinstance(obj, list)") syntax
from (I think) RuleDispatch, and I'm glad it's not in the PEP. I'm
unclear however on how you would do this otherwise -- is overloading
implies() the best approach?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
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

Reply via email to