#include <iostream> import sys std = type(sys)('std') class stream(object): def __init__(self, f): self.f = f def __lshift__(self, s): self.f.write(s) return self std.cout = stream(sys.stdout) std.endl = '\r\n' if 'nt' in sys.builtin_module_names else '\n' std.cout << "Hello " << "Python!" << std.endl #What could be more maintainable?
from __future__ import print_functionprint("Hello Python", end="!\n")- #include <iostream>
- import sys
- std = type(sys)('std')
- class stream(object):
- def __init__(self, f):
- self.f = f
- def __lshift__(self, s):
- self.f.write(s)
- return self
- std.cout = stream(sys.stdout)
- std.endl = '\r\n' if 'nt' in sys.builtin_module_names else '\n'
- std.cout << "Hello " << "Python!" << std.endl
- #What could be more maintainable?
Test.assert_equals(None, None)
- Test.assert_equals(None, None)