3 ms·
Gist: more concise output in Python
- tswicegood 16y agoCurious for some feedback here - anyone have any thoughts on it?
- tl 16y agoWell, I'd say C++'s std::ostream was a bad idea the first time, but if you're going to do it you might want to swap __lt__ for __lshift__.
- lukeqsee 16y agoWhy? print is all of 5 characters and universally understood. o = QuickOutputter() o < is 23 characters and not universally understood. Need I say more?
- tswicegood 16y agoThe idea would be using it inside a logger, this is more a syntax thing than anything else. The pseudo-code would be better explained as: log = get_logger() log < "some log message"
- sushibowl 16y agoIt is not clear to me how this is in any way better than the print statement itself