3 ms·
You can always consider print as low-level feature and wrap the whole thing in a fancy stream. class err_class: def __lshift__(self,other):
by alexk 18y ago
You can always consider print as low-level feature and wrap the whole thing in a fancy stream.
class err_class:
def __lshift__(self,other):
print(other)
return self
err = err_class()
err<<'fatal error:'<<'thats what happened'
- mojuba 18y agoOf course I can do it, then why isn't it done already in the language? Printing is something we do all the time in server applications, and that means, the printing facility in the language should be polished to death.
- alexk 18y agoThat's because really cool languages provide you with the power to build what you want, not the ton's of built-in fancy features.
- mojuba 18y agoThere is one advantage in having necessary stuff built into the language: others can understand your code quickly. As for printing, it is so basic and simple, if implemented right of course, that I wouldn't call it "tons of fancy features".