A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-July/154365.html below:

[Python-Dev] Assignment expression and coding style: the while True case

[Python-Dev] Assignment expression and coding style: the while True case [Python-Dev] Assignment expression and coding style: the while True caseSerhiy Storchaka storchaka at gmail.com
Thu Jul 5 02:30:25 EDT 2018
05.07.18 03:03, Victor Stinner пише:
> +                labels = [slabel for label
> +                          in self._file.readline()[1:].split(b',')
> +                          if (slabel := label.strip())]

                 labels = [slabel for label
                           in self._file.readline()[1:].split(b',')
                           for slabel in [label.strip()]
                           if slabel]

> +        lines = [match.group(1, 2)
> +                 for raw_line in raw_lines
> +                 if (match := line_pat.search(raw_line.strip()))]

         lines = [match.group(1, 2)
                  for raw_line in raw_lines
                  for match in [line_pat.search(raw_line.strip())]
                  if match]

But in all these cases I prefer the original loop.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4