[Python-ideas] issubclass(collections.OrderedDict, collections.Sequence)
Ram Rachum
ram at rachum.com
Tue Oct 7 22:10:56 CEST 2014
On Tue, Oct 7, 2014 at 11:00 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
>
> I implemented classes for this in my project and I'll see whether it's
>> useful (I'm already getting the feeling that a
>> `DefinitelyUnordered` base class is more useful as it's easier to capture
>> the unordered than the ordered.) If it proves
>> useful, I'll write back and if there'll be interest to put something like
>> this into Python, that'll be cool.
>>
>
> The big hurdles for getting anything new into Python are:
> - general applicability
> - additional expressive power
> - easing of hard-to-get-right tasks
> - etc.
>
> Claiming that something is so (such as Enum serial numbers) is not
> sufficient to make it so. You have to provide examples either from other
> languages or actual code that prove it, and hopefully be able to
> demonstrate that the need is greater than just your code base.
>
>
On one hand I understand the reasoning of looking for concrete use cases,
but on the other hand I think it has its drawbacks. There's lots of things,
like for example tuple.count, which if I remember correctly was added in a
pretty late version of Python (2.6 or something) and I needed it in a
previous version and it annoyed me that it wasn't there. You don't need to
wait for someone to say "Hey, I need `tuple.count`", if you have it on
`list` then people are probably gonna need it on `tuple` at one point or
another, so if it's a reasonable feature, I think it's good to provide it
early to save all that time, because it's obvious there are going to be use
cases.
Another example is PEP 3155. Instead of waiting for people to get
frustrated that they can't pass references to methods to
`multiprocessing.Process` and then having to wait for Python 3.3 to do
that, we could have preempted and implemented it before based on common
sense (i.e. if I have a method object, it should have information on it
telling where to find it.)
Of course, this approach has its disadvantages as well, and we always need
to be careful when adding anything to Python because it's a mostly
unreversible process.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141007/3d0c66c6/attachment-0001.html>
More information about the Python-ideas
mailing list