Re: [Python-Dev] Real-world use of Counter

2014年11月05日 12:31:03 -0800

Ethan Furman wrote:
Actually, it's asking, "Most other duck-typed methods will still raise a TypeError, but these few don't. Has that ever been a problem for you?"
I don't think I've *ever* been bothered by getting an
AttributeError instead of a TypeError or vice versa.
Both indicate bugs in my code, and I debug it by looking
at the code and traceback; I don't try to guess the problem
based solely on the exception type.
In this case the code would have to go out of its way
to turn an AttributeError into a TypeError. I don't
think the cost of that is worth whatever small benefit
there might be, if any.
Summary: Looks fine to me as it is.
--
Greg
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to