| Store | Cart

[Python-ideas] issubclass(collections.OrderedDict, collections.Sequence)

From: Ram Rachum <r...@rachum.com>
Sun, 5 Oct 2014 21:40:47 +0300
Hi guys,

I was just going to test whether a mapping is dict-like or an
OrderedDict-like object by doing this:

    isinstance(x, collections.Sequence)

But then I checked and saw that this is False:

    issubclass(collections.OrderedDict, collections.Sequence) is False

Why isn't an OrderedDict a Sequence?

_______________________________________________
Python-ideas mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
Recent Messages in this Thread
Ram Rachum Oct 05, 2014 06:40 pm
Stephen J. Turnbull Oct 08, 2014 04:37 am
Ed Kellett Oct 08, 2014 05:53 am
Ram Rachum Oct 07, 2014 08:01 pm
Alexander Belopolsky Oct 07, 2014 08:10 pm
Serhiy Storchaka Oct 05, 2014 07:52 pm
Guido van Rossum Oct 05, 2014 08:53 pm
Ram Rachum Oct 05, 2014 08:56 pm
Guido van Rossum Oct 05, 2014 09:53 pm
Ed Kellett Oct 05, 2014 10:05 pm
Ram Rachum Oct 05, 2014 10:07 pm
Guido van Rossum Oct 05, 2014 11:15 pm
Ram Rachum Oct 06, 2014 08:10 am
Guido van Rossum Oct 06, 2014 05:35 pm
Ram Rachum Oct 06, 2014 08:41 pm
Guido van Rossum Oct 07, 2014 12:40 am
Ram Rachum Oct 07, 2014 07:00 am
Cathal Garvey Oct 07, 2014 10:02 am
Ethan Furman Oct 07, 2014 07:05 pm
Ram Rachum Oct 07, 2014 07:45 pm
Guido van Rossum Oct 07, 2014 07:54 pm
Ethan Furman Oct 07, 2014 08:00 pm
Ram Rachum Oct 07, 2014 08:10 pm
Serhiy Storchaka Oct 06, 2014 12:02 pm
Andrew Barnert Oct 06, 2014 02:21 am
Raymond Hettinger Oct 06, 2014 01:26 am
Nick Coghlan Oct 08, 2014 05:29 am
Guido van Rossum Oct 08, 2014 04:00 am
rand...@fastmail.us Oct 08, 2014 03:54 am
rand...@fastmail.us Oct 09, 2014 12:49 pm
Ed Kellett Oct 09, 2014 11:46 am
Stephen J. Turnbull Oct 09, 2014 06:04 am
Stephen J. Turnbull Oct 08, 2014 01:09 am
Ram Rachum Oct 07, 2014 08:31 pm
Ethan Furman Oct 07, 2014 08:16 pm
Ram Rachum Oct 07, 2014 08:27 pm
rand...@fastmail.us Oct 07, 2014 08:28 pm
Messages in this thread