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-April/152981.html below:

[Python-Dev] assignment expressions: an alternative proposal

[Python-Dev] assignment expressions: an alternative proposal [Python-Dev] assignment expressions: an alternative proposalYury Selivanov yselivanov.ml at gmail.com
Tue Apr 24 12:11:50 EDT 2018
On Tue, Apr 24, 2018 at 12:03 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
[..]
> But I do write this:
>
>   def wrapper(func, some_value):
>     value_I_want = process(some_value)
>     def wrapped(*args, **kwds):
>       if value_I_want == 42:
>          ...

But this pattern is more rare than comparing local variables. That's
the point I'm trying to use.  Besides, to make it an assignment
expression under my proposal you would need to use parens. Which makes
it even less likely that you confuse '=' and '=='.

Yury
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