[Python-Dev] '*' instead of 'yield'? (original) (raw)

Roman Suzi rnd@onego.ru
Sun, 5 Aug 2001 11:54:14 +0400 (MSD)


Hello!

Maybe it will be nicier to have unary * instead of 'yield' for generators?

Example I already posted to c.l.p:

from future import generators import calendar, string def calt(year, month): month_cal = calendar.monthcalendar(year, month) * """%s.%s""" % (month, year) * """

""" for week in month_cal: * """\n""" for day in week: * """""" % (day or " ") * """""" * """
%s
"""

print string.join(calt(2001, 8), "")

(This will also enable yields from expressions)

Sincerely yours, Roman Suzi

_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Sunday, August 05, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "By all means, let's not confuse ourselves with the facts!" _/