[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing the way bash expands associative array subscripts
From: |
Dennis Williamson |
Subject: |
Re: Changing the way bash expands associative array subscripts |
Date: |
Tue, 6 Apr 2021 16:25:47 -0500 |
On Tue, Apr 6, 2021, 4:19 PM Eli Schwartz <eschwartz@archlinux.org> wrote:
> On 4/6/21 4:29 PM, Greg Wooledge wrote:
> > On Tue, Apr 06, 2021 at 03:24:54PM -0500, Dennis Williamson wrote:
> >> Python 3.7 has insertion-order dictionaries. So these are dependable
> >> gerbils.
> >
> > That explains my test results, which I didn't post. I had been told
> > in the past that python's dictionaries did NOT remember insertion
> > order, but I'm not fluent in python and I don't keep up with its changes.
>
> python, in general, has collections.OrderedDict, which is not some
> boring old dict but a special magic dict that does extra bookkeeping to
> remember insertion order.
>
> The default dict() in python 3.7 incorporates some, but not all, of the
> OrderedDict guarantees. For example, a boring dict() passes equality
> checks when compared to a dict with the same contents but different
> insertion order, while an OrderedDict does not pass equality checks.
>
> So, the gerbils do different things depending on which side of the box
> you open first. But they sometimes answer specific questions dependably.
>
> --
> Eli Schwartz
> Arch Linux Bug Wrangler and Trusted User
>
Thanks for that information. I had not compared dicts to OrderedDicts other
than superficially.
>
- Re: Changing the way bash expands associative array subscripts, (continued)
- Re: Changing the way bash expands associative array subscripts, Koichi Murase, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Ilkka Virta, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Ilkka Virta, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, konsolebox, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Dennis Williamson, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Eli Schwartz, 2021/04/06
- Re: Changing the way bash expands associative array subscripts,
Dennis Williamson <=
- Re: Changing the way bash expands associative array subscripts, konsolebox, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Koichi Murase, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Eli Schwartz, 2021/04/06
- Re: Changing the way bash expands associative array subscripts, Chet Ramey, 2021/04/08
- Re: Changing the way bash expands associative array subscripts, Chet Ramey, 2021/04/08
- Re: Changing the way bash expands associative array subscripts, Greg Wooledge, 2021/04/08
- Re: Changing the way bash expands associative array subscripts, Koichi Murase, 2021/04/08
- Re: Changing the way bash expands associative array subscripts, Chet Ramey, 2021/04/09
- Re: Changing the way bash expands associative array subscripts, Koichi Murase, 2021/04/09