Diez B. Roggisch wrote: > pipehappy wrote: > > >>Hello everyone: >> >>Is there a way to check the type when do assignment? >> >>if I write: >>ab = bc >>and want to make sure the return value of isinstance(bc, klass) is True >>or I will raise >>a exception. > > > In general, not doable. The assignment operator is not overloadable. > > Only if you use assignments of the form > > a.foo = bar > > you could overwrite the __setattribute__-method
(Or use a Descriptor) > to achieve what you want. > > Diez -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list