4 ms·
qw was great. Even in Python I sometimes write: usernames = ''' foo bar baz hello world '''.split() # instead of this, which needs too many keys
by hbrn 4y ago
qw was great. Even in Python I sometimes write:
usernames = '''
foo bar baz
hello world
'''.split()
# instead of this, which needs too many keystrokes
usernames = ["foo", "bar", "baz", "hello", "world"]
Interestingly, Python named tuples have similar interface for fields:
# all of these are equivalent
EmployeeRecord = namedtuple('EmployeeRecord', ['name', 'age', 'title'])
EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title')
EmployeeRecord = namedtuple('EmployeeRecord', 'name age title')
- culi 4y agoRuby was inspired by Perl and also has this. Pretty great