Currently I came across the code that returned 9 values (return statement spanned 5 lines due to pep8 limitation of 79 characters per line)
The function returns various values that are used by the template to render HTML To give you an idea - consider following two code snippets : (This is just a sample - it might lead you to believe these are various columns of a "user" table. Actual code isn't a row from DB table. All 9 values are computed, and aren't related to each other) Code 1: ... return dict(fname=fname, lname=lname, saluation=salutation, gender=gender, addr1=addr1, addr2=addr2, city=city, state=state, country=country) Code 2: user = {} user['fname'] = fname user['lname'] = lname ... ... ... user['country'] = country return dict(user=user) I was told first style is more "readable" since it tells you what is being passed to the template (I disagree, but it is subjective/personal opinion) Queries : 1. Is there a *limit* on "How many values can be returned from a function" ? 2. What is *performance impact* of returning so many values - (push and pop from the stack) 3. Based on #1 and #2 is there a *recommendation* on "where to draw the line" Thanks, -Mandar _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers