Robpol86 / terminaltables

Project no longer maintained.
https://github.com/matthewdeanmartin/terminaltables
MIT License
689 stars 71 forks source link

Convert non string data to string for column width. #15

Closed kovacsbalu closed 8 years ago

Robpol86 commented 8 years ago

I'm not really in favor for this. I think converting to strings should be left up to the developer using this library instead of the library. Here's a scenario:

Somebody subclasses str or writes their own mock str class with a custom splitlines() or other method. Passing everything through str() would strip out their changes and they lose control over their data.

I think the only valid use case for your pull request is for integers. For everything else besides integers you'll probably want to handle converting to strings yourself. With floats you'll want to specify the precision/decimal places shown in tables so this pull request won't really help with that. And null values will be "None" instead of "". This really is only for integers. Even with booleans some developers still use 0 or 1 instead of True/False.

kovacsbalu commented 8 years ago

Ok, I just got some strange error msg from your lib when I'm switched from another text-table lib.