[Python-ideas] Operator as first class citizens -- like in scala -- or yet another new operator?

Ricky Teachey ricky at teachey.org
Wed May 29 14:55:23 EDT 2019


>
> With a bit modification it can work, e.g. the last setattr(self, attr,
> value) should explicitly invoke SignalBehavior().__set__() instead.
>

You're absolutely right. For whatever reason I was thinking .__set__ gets
called first anyway (I am probably confusing this behavior with .__get__
and .__getattr__).

I believe that line should be:

SignalBehavior.__set__(getattr(type(self), attr), self, value)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190529/28824aa3/attachment.html>


More information about the Python-ideas mailing list