Intercepting binding?

andrew cooke andrew at
Thu Sep 24 04:41:25 CEST 2009

On Sep 23, 10:11 pm, Dave Angel <da... at> wrote:
> This comes up periodically in this list, and the answer is always
> something like:  you can't get there from here.

Well, I'm both flexible and desperate, so this is a possible route
(perhaps near enough):

import sys

class Foo(object):

    def __rlshift__(self, name):
            raise Exception()
            locals = sys.exc_traceback.tb_frame.f_back.f_locals
            locals[name] = self

if __name__ == '__main__':
    foo = Foo()
    'a' << foo


More information about the Python-list mailing list