Please try to find the largest set of methods that you're comfortable with. __add__ comes to mind.
Note that if you add __hash__, this rules out bytearray -- is that your intention? __hash__ is intentionally not part of the "read-only" ABCs because read-only doesn't mean immutable. Also, (again) please list which built-in types you want to register. On Mon, Jun 2, 2008 at 1:54 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > From: "Guido van Rossum" <[EMAIL PROTECTED]> >> >> All this makes me lean towards a rejection of this proposal -- it >> seems worse than no proposal at all. It could perhaps be rescued by >> adding some small set of defined operations. > > By subclassing Sequence, we get index() and count() mixins for free. > > We can also add other mixin freebies like __hash__(), __eq__(), __ne__(), > endswith(), startswith(), find(), rfind(), and rindex(). > > It's tempting to add center, lust, rjust, and zfill, but those require some > sort of constructor that accepts an iterable argument. > > As important as what is included are the methods intentionally left out. > I'm trying to avoid insisting on abstractmethods like encode(), split(), > join(), and other methods that place an undue burden on a class being > registered as a String. > > > Raymond > > > > > > -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com