3 ms·
I should point out that capitalize(), of course, returns a new capitalized string, just as it does in Ruby. But in Ruby you also have String#capitalize! So the
by jmillikin 17y ago
I should point out that capitalize(), of course, returns a new capitalized string, just as it does in Ruby. But in Ruby you also have String#capitalize!
So the quote deals with mutability? I suppose that makes more sense, since Ruby tends to favor mutable objects. Of course, to my Python-based mind changing the definition of 'a' or 3 seems like a poor idea.
And as for indentation, I think Guido should have followed through with making tabs a syntax error
Surely you mean "making spaces a syntax error"? That would be much more sensible, since using spaces for indentation is absurd. Even better would be simply ignoring spaces, since that allows them to be used for pretty-printing and alignment without any potential ambiguity.
Also, the bug in your example will not be difficult to figure out, because Python will/should raise an exception when parsing the malformed file. Not everybody runs with -tt, but that ought to be the default behavior (and is anywhere I get to control the installation).
- ketralnis 17y ago> Even better would be simply ignoring spaces Oh god no. Then you could have blocks that line up visually but execute in different scopes
- earthboundkid 17y agoPEP 8 specifies 4 spaces, not 1 tab. Python people generally prefer spaces to tabs, as do I, although I agree the semantically, it's a bit weird.