[Python-Dev] '*' instead of 'yield'?

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)
    * """<B>%s.%s</B>""" % (month, year)
    * """<TABLE BORDER=1>"""
    for week in month_cal:
      * """\n<TR>"""
      for day in week:
        * """<TD>%s</TD>""" % (day or "&nbsp;")
      * """</TR>"""
    * """</TABLE>"""

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!" _/