adalfarus / aplustools

A collection of helpful tools
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Easy property #33

Closed adalfarus closed 2 weeks ago

adalfarus commented 3 weeks ago

Add a class that is basically an attribute and you can say idk: Don't be changeable, so you don't have to use @property so often.

adalfarus commented 2 weeks ago

Deemed impossible, get and set only work for class attributes, not instance attributes. EasyProperty for those class attributes will still be available.

You can use EasyAttribute that sets a private attribute for every instance and always allows one write. (You set it as a class attribute but when you modify it in an instance it sets and reads only instance attributes that are derived from the given name you set when initializing it)