Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Calling it from the empty string concatenates the pieces with no separator, which is a Python quirk and rather surprising at first.

This is stated twice, but I can't make any sense of it. How is this even remotely surprising? What else would anyone possibly expect joining with the empty string as the separator to do?



The surprising thing is that .join is a method of the separator, not of the list of pieces.


I'm pretty sure it's a string method so it can take any iterator as an argument.


I think that was the deciding argument, yes.


I think he's referring to backwards nature of string joining in general.




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

Search: