On 5/08/20 9:13 pm, Serhiy Storchaka wrote:
the code can be written as

     class Neuron:
         activation = linear_activation(activation)

I do not see reasons to introduce special syntax for this very specific
code.

A considerable number of moons ago, I suggested that

    @my_property
    fred = 42

should expand to

    fred = my_property("fred", 42)

The point being to give the descriptor access to the name of
the attribute, without having to repeat yourself.

--
Greg
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QUKYFIWYJY42ZMNJM4EXOUWBMKK42VXH/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to