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/2000-March/002949.html below:

Do we need a UserString class?

[Python-Dev] [1.6]: UserList, Dict: Do we need a UserString class? [Python-Dev] [1.6]: UserList, Dict: Do we need a UserString class?Guido van Rossum guido@python.org
Wed, 29 Mar 2000 07:35:33 -0500
> > What's wrong with my implementation of __hash__ raising a TypeError with
> > the attribution 'unhashable object'. 
> 
> A subtype shouldn't change contracts of its supertypes. hash() was
> implicitly contracted as "raising no exceptions".

Let's not confuse subtypes and subclasses.  One of the things implicit
in the discussion on types-sig is that not every subclass is a
subtype!  Yes, this violates something we all learned from C++ -- but
it's a great insight.  No time to explain it more, but for me, Peter's
subclassing UserString for MutableString to borrow implementation is
fine.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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