[Python-Dev] Compact ordered set

Henry Chen tahafut at gmail.com
Wed Feb 27 17:23:30 EST 2019


If sets were ordered, then what ought pop() return - first, last, or
nevertheless an arbitrary element? I lean toward arbitrary because in
existing code, set.pop often implies that which particular element is
immaterial.

On Wed, Feb 27, 2019 at 2:18 PM Barry Warsaw <barry at python.org> wrote:

> On Feb 27, 2019, at 13:54, Chris Barker via Python-Dev <
> python-dev at python.org> wrote:
> >
> > A mapping and a set type really don't have much to do with each other
> other than implementation -- anyone that isn't familiar with python C code,
> or hash tables in general, wouldn't likely have any expectation of them
> having anything to do with each other.
>
> I’m just relaying a data point.  Some Python folks I’ve worked with do
> make the connection between dicts and sets, and have questions about the
> ordering guarantees of then (and how they relate).
>
> -Barry
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/tahafut%40gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190227/3f89e115/attachment-0001.html>


More information about the Python-Dev mailing list