[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: zsh style associative array assignment bug
From: |
Andreas Schwab |
Subject: |
Re: zsh style associative array assignment bug |
Date: |
Mon, 29 Mar 2021 09:47:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
On Mär 28 2021, Greg Wooledge wrote:
> Python is different:
>
>>>> y = ["a", "b", "c", "d"]
>>>> dict(zip(y[::2], y[1::2]))
> {'a': 'b', 'c': 'd'}
>>>> x = ["a", "b", "c"]
>>>> dict(zip(x[::2], x[1::2]))
> {'a': 'b'}
>
> It seems to discard the last (unmatched) value.
>>> dict(zip_longest(x[::2], x[1::2]))
{'a': 'b', 'c': None}
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
- zsh style associative array assignment bug, Eric Cook, 2021/03/27
- Re: zsh style associative array assignment bug, Oğuz, 2021/03/28
- Re: zsh style associative array assignment bug, Eric Cook, 2021/03/28
- Re: zsh style associative array assignment bug, Oğuz, 2021/03/28
- Re: zsh style associative array assignment bug, Ilkka Virta, 2021/03/28
- Re: zsh style associative array assignment bug, Oğuz, 2021/03/28
- Re: zsh style associative array assignment bug, Eric Cook, 2021/03/28
- Re: zsh style associative array assignment bug, Oğuz, 2021/03/28
- Re: zsh style associative array assignment bug, Greg Wooledge, 2021/03/28
- Re: zsh style associative array assignment bug,
Andreas Schwab <=
- Re: zsh style associative array assignment bug, Ilkka Virta, 2021/03/29
- Re: zsh style associative array assignment bug, Robert Elz, 2021/03/28
- Re: zsh style associative array assignment bug, L A Walsh, 2021/03/29
Re: zsh style associative array assignment bug, Chet Ramey, 2021/03/29
- Re: zsh style associative array assignment bug, Eric Cook, 2021/03/29
- Re: zsh style associative array assignment bug, Chet Ramey, 2021/03/30
- Re: zsh style associative array assignment bug, Eric Cook, 2021/03/30
- Re: zsh style associative array assignment bug, Greg Wooledge, 2021/03/30
- Re: zsh style associative array assignment bug, felix, 2021/03/31
- Re: zsh style associative array assignment bug, Greg Wooledge, 2021/03/31