• Serhiy Storchaka's avatar
    bpo-10544: Deprecate "yield" in comprehensions and generator expressions. (GH-4579) · 73a7e9b1
    Serhiy Storchaka yazdı
    The current behaviour of yield expressions inside comprehensions  and
    generator expressions is essentially an accident of implementation - it
    arises implicitly from the way the compiler handles yield expressions inside
    nested functions and generators.
    
    Since the current behaviour wasn't deliberately designed, and is inherently
    confusing, we're deprecating it, with no current plans to reintroduce it.
    Instead, our advice will be to use a named nested generator definition
    for cases where this behaviour is desired.
    73a7e9b1
expressions.rst 71 KB