PEP 308: some candidate uses cases from live code

Kyler Laird Kyler at news.Lairds.org
Mon Feb 10 12:49:15 EST 2003


claird at lairds.com (Cameron Laird) writes:

>No partial-wink disclaimers?  Myself, I think casual maintainers
>(and that *is* our target audience as Real-Life Programmers, 
>right?) will find
>  sy = d0.year
>  if d0.month < 7:
>      sy -= 1
>best serves.

Anyone want to claim that this is preferable for some?
	if d0.month < 7:
		sy = d0.year - 1
	else:
		sy = d0.year

I cringe at the duplication of "d0.year" but I've been
teaching Scheme recently and noticed that students seem
very comfortable saying "If this is the case, then the
answer is this, otherwise..." instead of "Always do this
and then if whatever, modify the result."

I'm not sure how I feel about it.

--kyler




More information about the Python-list mailing list