Chris:
> I'm not sure about other people, but I have never, not once, used
> @property as a means of controlling access. So giving me another way
> to do something that I am not, and don't want to, do... isn't much of
> an argument. :)

Ok. I'm giving you another example that doesn't cause security issues but 
instead instability. Consider this,

class A:
    def __init__(self, name):
        self.name = name
    def create_file(self):
        with open(name, "a") as file:
              name.write("something")

Now consider this,

[1]: x = A("Name")
[2]: x.create_file() # Creates a file named "Name"
[3]: x.name = "name"
[4]: x.create_file() # Creates a file named "name"

We never created a object for "name" but still there's a file named "name" out 
there. This is the work of read-only attribute. They prevent such instability 
issues.
_______________________________________________
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/LCRQI233EELWOVMNI2IDMF4YXJRU4YMT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to