On Wed, 29 Mar 2000, Peter Funk wrote: > > 1. I tshouldn't share implementation with UserString, otherwise your > > algorithm are not behaving with correct big-O properties. It should > > probably use a char-array (from the array module) as the internal > > representation. > > Hmm.... I don't understand what you mean with 'big-O properties'. > The internal representation of any object should be considered ... > umm ... internal. Yes, but s[0] = 'a' Should take O(1) time, not O(len(s)) > > 2. It shouldn't share interface iwth UserString, since it doesn't have a > > proper implementation with __hash__. > > 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". -- Moshe Zadka <mzadka@geocities.com>. http://www.oreilly.com/news/prescod_0300.html http://www.linux.org.il -- we put the penguin in .com
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