A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2018-April/153265.html below:

[Python-Dev] PEP 572: Assignment Expressions

[Python-Dev] PEP 572: Assignment Expressions [Python-Dev] PEP 572: Assignment ExpressionsAntoine Pitrou antoine at python.org
Mon Apr 30 11:45:46 EDT 2018
Le 30/04/2018 à 17:30, Chris Angelico a écrit :
> 
>> def do_things(fire_missiles=False, plant_flowers=False): ...
>> do_things(plant_flowers:=True) # whoops!
> 
> If you want your API to be keyword-only, make it keyword-only. If you
> want a linter that recognizes unused variables, get a linter that
> recognizes unused variables. Neither of these is the fault of the
> proposed syntax; you could just as easily write this:
> 
> do_things(plant_flowers==True)

Unless you have a `plant_flowers` variable already defined, this will 
raise a NameError, not plant a silent bug.

Regards

Antoine.

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