Hacker News new | past | comments | ask | show | jobs | submit login

I know Python far better than Ruby, but it looks like the semantics are equivalent, it's just that Ruby's standard `open` implementation includes the cleanup rather than leaving it up to the caller as in Python.



One difference is that Ruby does not need a special language construct/protocol to do so.

An other is that Python's "context managers" are reified which means you can pass them around until you ultimately use them. It's a tradeoff.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: