[docs] PEP 380: Syntax for Delegating to a Subgenerator (3.5.1 and others?)

bob gailer bgailer at gmail.com
Tue Sep 27 10:18:48 EDT 2016


2nd example:

 >>> def accumulate():
...     tally = 0
...     while 1:
...         next = yield
...         if next is None:
...             return tally
...         tally += next

In general we discourage assignment to built-in functions (next in this 
case). I recommend using some other name.

Also it seems to me that we encourage use of True instead of 1 where 
True is intended.



More information about the docs mailing list