Hacker News new | past | comments | ask | show | jobs | submit login

> String.upper(msg)

That was the original syntax [0], before the string functions became methods. I agree that a method more strongly implies mutation than a function does.

Also, for consistency with list methods like `reverse` (which acts in place) and `reversed` (which makes a copy), shouldn’t the method be called `uppered`?!

[0] https://docs.python.org/2/library/string.html#deprecated-str...




'uppercased'


Ah, of course.

Also, it looks like that’s the name that Swift uses.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: