Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Slightly off-topic: In Python you will also benefit from using the sorted and reverse functions to avoid mutability. Generator functions are a nice way to build collections without using explicit append:

  def collection ():
    list = []
    while someLoopCondition ():
      while someOtherLoopCondition ():
        list.append (someStuff ())
    return list
vs

  def collection2():
    while someCondition ():
      while someOtherLoopCondition ():
        yield someStuff ()


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: