On 5/19/06, Collin Winter <[EMAIL PROTECTED]> wrote:
> ... what do you think of ... having bracket-based parameterization be
> redirected a call to some double-underscore method
It already is -- to __getitem__.
Having it go to something else just because you're in a function
definition is asking for trouble. What should happen in the following
case?
b=dict(strict=check1, lenient=check2, normal=check3)
def foo(a:b["normal"]): pass
Should it really look for some special method on b (or b's type) just
because it is in a signature context? Today, the annotation
expression would evaluate to check2, and I'm not looking forward to
figuring out all the corner cases on when that wouldn't happen.
-jJ
_______________________________________________
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