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

On the other hand, it means any helper/builder has to handle this pattern on its own rather than be able to return a file object which can be "context managed" by a caller, which Python allows.


True, but it's fairly easy to write:

    def self.open
      File.open(...) { |f| yield f }
    end
Unless they need custom destructor actions, in which case presumably they'd have to implement that manually in python too.


Yup and yup.




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

Search: