[Python-Dev] Removing types module from stdlib
Kevin Jacobs
jacobs@penguin.theopalgroup.com
Fri, 31 May 2002 15:34:27 -0400 (EDT)
On Fri, 31 May 2002, Guido van Rossum wrote:
> str and unicode have special status and it shouldn't be easy to create
> something else (not deriving from either) that also gets this special
> status. (You can still do it in C of course.)
I use this little toy on occasion:
class istr(str):
__slots__ = ()
def __hash__(self):
return hash(self.lower())
def __eq__(self, other):
return self.lower() == other.lower()
def __ne__(self, other):
return self.lower() != other.lower()
def __le__(self, other):
return self.lower() <= other.lower()
def __ge__(self, other):
return self.lower() >= other.lower()
def __lt__(self, other):
return self.lower() < other.lower()
def __gt__(self, other):
return self.lower() > other.lower()
Are you saying that you want to outlaw it?
-Kevin
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com
Fax: (216) 986-0714 WWW: http://www.theopalgroup.com