[Python-3000] PEP 3119 - Introducing Abstract Base Classes (original) (raw)
Jim Jewett jimjjewett at gmail.com
Fri Apr 27 21:06:31 CEST 2007
- Previous message: [Python-3000] PEP 3119 - Introducing Abstract Base Classes
- Next message: [Python-3000] PEP 3119 - Introducing Abstract Base Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 4/27/07, Thomas Lotze <thomas at thomas-lotze.de> wrote:
Guido van Rossum wrote:
>
_hash_for those instances should raise aTypeError> exception.
Shouldn't this rather be a ValueError since it occurs not because of the type of the object in question, but its value (while in general, there are instances of the same type representing other values which are hashable)?
Yes, but it is a TypeError today. Is it worth the backwards compatibility?
> [It] is possible for ``x > in o
to be True even thoughxis never yielded byiter(o)``.
To me, 'searchable' isn't associated with subsequences in any way. I'd think of a container that is able to answer the question "where is this element?" A sequence might return an index or a set of indexes, a mapping might return a key or a set of keys in reply to this. If what you're after is really a subsequence containment test, it should just live on sequences instead of getting an ABC of its own, IMO.
That makes sense. Looking at unordered containers like sets, should
{"a", "b"} in {"b", "a", "d"} be able to return true, by deriving from Searchable?
If not, then I agree that it is really about sequences.
-jJ
- Previous message: [Python-3000] PEP 3119 - Introducing Abstract Base Classes
- Next message: [Python-3000] PEP 3119 - Introducing Abstract Base Classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]