If this works well, perhaps more people can get commit access. Also,
perhaps Anand can develop a new version that uses return codes instead
of print statements and other good stuff.
As indicated in other threads replacing print with return codes is not what the entire community wants.
No offense, but I don't want to have to think about stuff like that --
that's why I use something transparent like webpy. If I want rich and
complex, I'll use something else -- web.py doesn't have to be everything
to everybody, that's what is great about having 700 python web frameworks.
> b.t.w Good Luck, Anand, and thank you Aaron for servicing the community so
> well.
Indeed. Many hands make light work.
--
David Terrell
d...@meat.net
((meatspace)) http://meat.net/
> It should be possible to have both.
>
> .. a special variable called 'printed' that holds the accumulated stuff from print statements ...
> In addition to that, we could use 'printed' if the function hasn't returned anything ...
I don't want to have to think about stuff like that
On 12/19/06, Tim Riley <ril...@gmail.com> wrote:As indicated in other threads replacing print with return codes is not what the entire community wants.
It should be possible to have both.
In ZOPE we used to have a special variable called 'printed' that holds the accumulated stuff from print statements, so you could, for example, write:
print 'this'
print 'that'
return transform(printed)
In addition to that, we could use 'printed' if the function hasn't returned anything (so that existing code doesn't break and those users who like the print idiom better than return aren't dissapointed).
b.t.w Good Luck, Anand, and thank you Aaron for servicing the community so well.
I think having both [print and return] is not very nice.
I am happy to use either if both gives the functionality i want. But the problem with prints is it doesnt allow me to reuse/pipeline the code.
If returns is a better way, then i think its okay to break the backward compatability, as it happend before[1].
On 12/19/06, Anand <anand...@gmail.com> wrote:I think having both [print and return] is not very nice.
Well, that's a matter of taste, of course. The point is that you never have to use both of them. Is your objection more from a maintainer's point-of-view, or do you think that providing more than one way of doing things is unpythonic?
I think that as web.py gains more users it becomes less and less responsible to do that (especially if you don't keep maintaining older branches). I, for example, have several large-ish projects using web.py to maintain and I'd hate to have to change the program whenever I want to upgrade web.py (to benefit from a bug-fix or a new useful feature, for example).
Upgrading to v2 was somewhat painful, to be honest, and none of the changes were as big as this one.
Finally, the print idiom is not necessarily a bad one in cases where the only other option would be string concatenation or accumulation.
My choice would be, in order of preference:
1. print + return
2. return
3. print
4. ruby on rails :)
Finally, the print idiom is not necessarily a bad one in cases where the only other option would be string concatenation or accumulation.You can use yield as well.
In ZOPE we used to have a special variable called 'printed' that holds the accumulated stuff from print statements
Anand, you may have a look at this too :
http://groups-beta.google.com/group/webpy/browse_thread/thread/e69acd5722a30708/3152d5145e0d181e?lnk=gst&rnum=1#3152d5145e0d181e