-
-
Save alvesjnr/a1f65d9960237a2652c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Python is not Java | |
""" | |
import sys | |
def print_value(value): | |
sys.stdout.write(str(value) + '\n') | |
class PrintValue(object): | |
def __init__(self): | |
pass | |
def __call__(self,value): | |
sys.stdout.write(str(value) + '\n') | |
if __name__ == '__main__': | |
" Why do you do this: " | |
pv = PrintValue() | |
pv(666) | |
" Instead of just do it: " | |
print_value(42) | |
" ?? " | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment