Author j1m
Recipients j1m
Date 2010-07-10.19:52:28
SpamBayes Score 5.18251e-09
Marked as misclassified No
Message-id <>
In python 2.7 a module can't be used as a context manager.

For example, given the module,

    def __enter__(*args):
        print 'enter', args

    def __exit__(*args):
        print 'exit', args

In Python 2.6:

    >>> import t
    >>> with t: pass
    enter ()
    exit (None, None, None)

In Python 2.7:

    >>> import t
    >>> with t: pass
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: __exit__
Date User Action Args
2010-07-10 19:52:30j1msetrecipients: + j1m
2010-07-10 19:52:30j1msetmessageid: <>
2010-07-10 19:52:28j1mlinkissue9220 messages
2010-07-10 19:52:28j1mcreate