A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-November/136904.html below:

[Python-Dev] Real-world use of Counter

[Python-Dev] Real-world use of Counter [Python-Dev] Real-world use of CounterGreg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 5 21:28:49 CET 2014
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4