"Steven Bethard" <[EMAIL PROTECTED]> writes:

> Which brings me to my comment about the current discussion.  Can't we
> drop the syntax discussion for a while and have someone motivate it
> with some use-cases first?  Sure, I can figure out what ``dict[str,
> str|int]`` means, but I still have no idea what you'd gain by
> declaring a parameter to have such a type.  Should it add checks every
> time __getitem__ or __setitem__ is called?

Indeed. And if passes through a variable with a declared type multiple
times in a loop, would it accumulate multiple checking layers?

If "mapping" is substituted for "dict", is it wrapped while preserving
the class? How?

IMHO any type checking which would require wrapping in a checking
layer makes no sense; besides the risk of accumulating checking
layers, it doesn't detect type violation at the time of the check
anyway.

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
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