[Python-Dev] assignment expressions: an alternative proposal (original) (raw)
Yury Selivanov yselivanov.ml at gmail.com
Tue Apr 24 12:11:50 EDT 2018
- Previous message (by thread): [Python-Dev] assignment expressions: an alternative proposal
- Next message (by thread): [Python-Dev] assignment expressions: an alternative proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Apr 24, 2018 at 12:03 PM, Ethan Furman <ethan at stoneleaf.us> wrote: [..]
But I do write this:
def wrapper(func, somevalue): valueIwant = process(somevalue) def wrapped(*args, **kwds): if valueIwant == 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
- Previous message (by thread): [Python-Dev] assignment expressions: an alternative proposal
- Next message (by thread): [Python-Dev] assignment expressions: an alternative proposal
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]