title: Should a context object work when used without 'with'?
body: <p>I'm not quite sure how to implement a context manager for a custom class. Basically it's just accepting a file name in <code>__init__</code>, opening the file in <code>__enter__</code> and closing it in <code>__exit__</code>.</p>
  
  <p>E.g., like:</p>
  
  <pre><code>class BlaFile:
      def __init__(self, file_name):
          self.file_name = file_name
  
      def __enter__(self):
          self.file = open(self.file_name, "rb")
          return self
  
      def __exit__(self, exc_type, exc_val, exc_tb):
          self.file.close()
  
      def do_stuff_with_file():
          # This will fail when I'm using this class without 'with'.
          return self.file.read(1)
  </code></pre>
  
  <p>However, when I'm not going to instantiate / use the class with the 'with' statement, I will not be able to use any functions of it which access the file, as <code>__enter__</code> has never been called; and thus the file is not open.</p>
  
  <p>Maybe I'm too much oriented towards C#'s <code>using</code> keyword here; but shouldn't I be able to correctly use an instance of the class even when I'm not using it with the <code>with</code> keyword? Right now I'm forced to use it with it - is that the typical usage in Python?</p>