On Sat, 4 Jun 2022 at 22:16, Steven D'Aprano <st...@pearwood.info> wrote:
>
>
> On Sat, Jun 04, 2022 at 10:04:39AM -0000, Steve Jorgensen wrote:
>
> > OK. That's not terrible. It is a redundancy though, having to re-state
> > the count of variables that are to be de-structured into on the left.
>
> Redundancy is good:
>
>     # Obviously, clearly wrong:
>     spam, eggs, cheese = islice(myvalues, 5)

Yes but which part is wrong?

>     # Not obviously right.
>     spam, eggs, cheese, * = myvalues
>
> We don't have to squeeze every bit of redundancy out of code.
>

Redundancy introduces possibilities of desynchronization. ANY code can
be wrong, but it's entirely possible for the second one to be right,
and the first one is undoubtedly wrong.

In this case, redundancy is merely noise, like me saying a second time
that redundancy is merely niose, except that the duplicate can be
wrong.

Obviously sometimes it's unavoidable, but I don't think we can
genuinely accept that the redundancy is *good*.

# Obviously right, but inefficient.
spam, eggs, cheese, *_ = myvalues

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QGZHTONMPGOOJX4WGUMJQSDUZSWHSQJE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to