Thread: Philosophical question on python syntax
i'm used fortran programming, , starting adventure me python, many people speak it. have made first toy program, opens file, reads content, , closes it. closing it, 1 uses:
file.close()
in fortran
close(file)
how did work mind of people developing python such think python syntax more readable or clear other one? or there fundamental reason using prevents fortran-style syntax being used? really, i'm asking bottom of heart, in hope understand.
instance, in python 1 writes
print 'something'
logic, should be
'something'.print()
or that. find strange.
is function call passing 'file' first argument.code:close(file)
is method call. 'file' object, , 'close' property of object.code:file.close()
need oop damaged brain understand basic concept. previous knowledge of c++ there...
regards
Forum The Ubuntu Forum Community Ubuntu Community Discussions The Cafe Philosophical question on python syntax
Ubuntu
Comments
Post a Comment