Quote: "I like the forced indent in python but dislike the feeling that nothing is ever 'officially' closed"
I've seen people compensate for that by using comments:
class DBPGameStats(object):
def __init__(self):
self.__entries = dict()
def get_list_of_authors(self):
authors = list()
for key, value in self.__entries.iteritems():
if not value['author'] in authors:
authors.append(value['author'])
return sorted(authors)
Changed to:
class DBPGameStats(object):
def __init__(self):
self.__entries = dict()
#__init__(self)
def get_list_of_authors(self):
authors = list()
for key, value in self.__entries.iteritems():
if not value['author'] in authors:
authors.append(value['author'])
#if not value['author'] in authors
#for key, value in self.__entries.iteritems()
return sorted(authors)
#get_list_of_authors(self)
#class DBPGameStats(object)
But I feel that clutters it more. A good editor will highlight which block you're in anyway, so I presume people who write python code like that are using something stupid like IDLE or notepad.
As to the braces, this is also a style people use:
if(iOpenABlock){
doStuff();
}
if(iOpenABlock)
{
doStuff();
}
if(iOpenABlock)
{ doStuff();
}
It keeps the braces on the same indentation level and it doesn't waste an extra line of code.
I like offending people. People who get offended should be offended. --
Linus Torvalds