invoking multiple methods (Was: Python vs. Ruby)

Andrew Dalke adalke at
Thu Jan 9 23:17:05 CET 2003

Jack Diederich wrote:
> Some people seem to like lists, etc to return an lvalue and other
> people think it dilutes the language.  To borrow from another language
> would something like
> import lvalues from pragma
> be acceptable?

No because then it would be a dialect of Python and would make
others' code harder to understand and use.

> The return values that are currently None would then be self for all
> calls in that module.

I think you mean to say "currently have no explicit return value"

class Spam:
   def eggs(self, i):
       x = some.other.module()
       if i > 3:
         return x
       elif i == 3:
         return None

If i > 3 and x is None, this has an explicit return value, which
   happens to be None.
If i == 2, it has an explicit return value of None.
If i < 3, it has an implicit return value of None.

Oh, and so far None isn't a reserved word (will be in the future)
so I could have had 'None = 3'

Try to please all the people all the time and you end up pleasing
few.  In Guido we trust ;)

					dalke at

More information about the Python-list mailing list