My (late) beef with Simple Generator syntax (PEP 255)

Niki Spahiev spahievi at vega.bg
Thu Nov 14 15:47:37 EST 2002


11/13/2002, 22:37:28, Cameron Horn wrote:


CH> Assuming that having an empty generator is as valid as empty functions and classes, what kind of linguistic cruft is that?  I expect better out of python, dang it.

CH> What I'd like to write is:
CH> gen foo():
CH>    return


def foo():
    if 0: yield None

optimized to empty generator by compiler
-- 
Best regards,
 Niki Spahiev





More information about the Python-list mailing list