A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/016723.html below:

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

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





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4