On Thu, Aug 6, 2020 at 6:16 PM <redrad...@gmail.com> wrote:
>
> I think a property decorator can be useful, because you consider the simplest 
> case with:
> ```python
> class MyClass:
>     @my_property
>     name = arg
> ```
> but consider it can generate the following code:
> ```python
> class MyClass:
>     def name(self):
>         ...
>
>      def see_name(self):
>         ...
> ```

Hmmm. I don't really like it, but worst case, you can do this with
__set_name__ and mutating the target class. You wouldn't decorate it,
just assign a my_property object to the name you want.

Alternatively, decorate the class itself with something that does
whatever changes you want.

ChrisA
_______________________________________________
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/ZADQN5GRD43HTGYIBNZSJL7YKYRTXKVU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to