[1] Every couple of years, I decide to learn Java, and start going through
a book -- usually the same book. It doesn't go long before I say to my
self, Gosh, why would I ever want to program this language, anyway?
I've taught myself Java three times(*), first from the O'Reilly Nutshell
book
Michael Broe said unto the world upon 17/02/06 03:57 PM:
snip
Second question. Do I really have to write the sort_print() function
like this:
def sort_print(L):
L.sort()
print L
i.e. first perform the operation in-place, then pass the variable? Is
this the
Perhaps you've seen this already, but since you are wrapping the print
in a function, I suspect you want the original list to be unmodified.
Thus, compare:
def sort_print1(a_list):
a_list.sort()
print a_list
def sort_print2(a_list):
t = list(a_list)
On Fri, 17 Feb 2006, Kent Johnson wrote:
Ruby has an interesting approach to this - the names of mutating methods
end with !. So it would be list.sort!() which gives a strong cue to what
is happening.
What a great idea! Hmm.. maybe Python could do this, too; and use some
other characters
Ruby has an interesting approach to this - the names of mutating methods
end with !. So it would be list.sort!() which gives a strong cue to what
What a great idea! Hmm.. maybe Python could do this, too; and use some
other characters like $, @ and % to indicate if a name is a reference to a
On Sun, 19 Feb 2006, Alan Gauld wrote:
But don't even joke about it.
It is pretty cringe-worthy, isn't it?
Decorators are bad enough, no more line noise in Python.
I was actually kind of sad to see that added. It struck me as the first
grafted-on feature of Python that *felt* grafted-on.