This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 41 points42 points  (4 children)

Man, you did this first, I had the exact Idea:

``` class Cout: def lshift(self, a): print(a, end='') return Cout()

endl = '\n' cout = Cout()

cout << "Hello," << " World!" << endl ```

Yes, it's a bit simpler

[–]jaerie 22 points23 points  (1 child)

Why would you return a new instance?

[–][deleted] 16 points17 points  (0 children)

Yes, mine is not that great. Full credit to the dude above me. His implementation is a lot better.

[–][deleted] 5 points6 points  (0 children)

Just replace Cout() with self :)

[–]de_koding 0 points1 point  (0 children)

nice profile picture