On Wed, Feb 27, 2013 at 8:30 AM, Antoine Pitrou <solip...@pitrou.net> wrote:
> I don't think extra-strong typing of constants is really useful in
> practice; it smells a bit like private methods to me.

I think checking that a value comes from a particular enum *is* a degree of
hand-holding.  For libraries or frameworks whose users aren't expected to
know them exhaustively, making reasonable checks of parameters can
substantially reduce the number of ways it can be used incorrectly.  Outside
performance critical code, this is a win.


  -Fred

-- 
Fred L. Drake, Jr.    <fred at fdrake.net>
"A storm broke loose in my mind."  --Albert Einstein
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to