Guido van Rossum wrote:
If we had access to the syntax used for the definition, this would be simple: assignments define items, def statements define methods. But at run time we only see the final object resulting from the definition,
Another way we could tell the difference is if the def statement used a different protocol for making bindings than assignment. Suppose a def statement used in a class body called __defitem__, if it exists, instead of __setitem__. Then the metaclass would be able to do different things for defs and assignments. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com