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

You depend on the standard library anyway.


So using the library doesn't have a cost?


The cost to importing an extra module is trivial.

Why reinvent the wheel, when Python ships with an already written and tested solution? The 3 lines of code you would write are probably going to miss some corner case.

If I'm reading some unfamiliar code I would rather see one use of a standard library function call than several lines that I have to read and understand. And if it was really the first time I came across the `fileinput` module, I only have to pay the cost of reading the documentation once, and then forever benefit from having to read and understand less code whenever it is used.




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

Search: