Ziga Seilnacht wrote:
> >>> def in_class_statement2():
> ...     frame = sys._getframe(1)
> ...     return '__module__' in frame.f_locals and not \
> ...            '__module__' in frame.f_code.co_varnames

On second thought, to break this check is less easy than I expected, so
maybe it is reliable enough. BTW, if you are interested, you can check
the original code in zope.interface.advice.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to