Apparently, in Las Vegas, you can shoot naked women with paint ball guns.
Unless, that is, it's not true. But no, it has to be true. It just has to be. ;-)
"Video for this story is no longer available." Shame.
Via Rebecca Blood.
Questions and Answers about Foreign Policy (and the U.S. Invasion of Iraq)
Andrew Kuchling has updated his Python Warts page, to take recent changes to Python into account.
There are a couple of things in there that I really don't see as warts at all. Raw strings, for example, seem to me to be a a fairly elegant was of solving the escaping problem.
The explicit self. requirement is something I find helpful. It makes it obvious whether you are dealing with an instance variable or a local one. In Java, I always use the this. prefix.
The .join() string method? What can I say? I've just got so used to it now that I wouldn't have it any other way. Besides, the martellibot has shown why join() is best implemented as a string method.
What's missing? Well, as of 2.3, you still need the string module for several constants, even though (almost all) the functions are available as string methods. But I gather that by version 3.0, the string module will be deprecated. So by then, the constants will have to have been put somewhere else - probably they'll be attributes of the built-in str object.
Assuming that the str object does grow attributes, the idea could be extended. When you open a file using the built-in file() object, you need to pass it a bunch of mode flags. These you pass as strings, which I find ugly - another wart, IMHO. These could easily become attributes of file. So, instead of:
myFile = file(filename, 'rb')
, you could do:
myFile = file(filename, file.READ + file.BINARY)
Longer, yes, but easier to remember and to read, I think.
Opening files isn't the only place where you use fairly arbitrary characters like this - the struct module springs to mind, where you have 'format characters'. These should defined as constants by the module, I think.
Oh yes, one other thing. os.path.walk must die. And I see it's on its way out now - the Timbot's new os.walk generator has made it into 2.3, and a thing of beauty it is too.
People ought to have to pass some form of a test, like a driving test, before they are allowed to use dangerous implements like umbrellas.
If you are, oh, say six foot two, you'll find that very many people hold their umbrellas with the spokes at your eye level. And then appear to do their level best to poke your eyes out.