On Sat, Nov 28, 2009 at 1:26 PM, Lie Ryan <[email protected]> wrote:
> On 11/27/2009 7:03 PM, Stefan Lesicnik wrote:
>> - functions should return one value (im not 100% of this one)
>
> I 100% disagree or with this one.
Me too. Actually I think it is meaningless - every Python function
returns one value, an instance of some class. Each of these functions
returns one value - a list, a tuple and a Foo instance:
def make_list():
return [0, 1]
def make_tuple():
return 0, 1
class Foo(object):
def __init__(self, a, b):
self.a = a
self.b = b
def make_Foo():
return Foo(0, 1)
BTW when I first saw this rule I mis-read it as "Functions should have
a single point of return" which is fairly common advice that I also
disagree with.
Kent
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor