Definition of "property"

Avi Gross avigross at verizon.net
Sun May 30 23:15:28 EDT 2021


You guys are all very knowledgeable but he is asking what to say to an
EDITOR who clearly may know little or nothing about computers and thinks
python is a snake and not a language and may need to be spoken to in his own
language which understands other forms of abstraction better.

So, just for humor, give him the communist version of property. Property is
owned by the state and is a reflection of such a state. It is hidden and can
only be accessed through apparatchiks working for the state. You tell them
what you want and they go invisibly and do whatever they want which may even
include manipulating what lies underneath the capitalist concept of a
property. This is called a Setter as in you set it up and they knock it
down.

Now when you ask for some kind of report of what the property is now like,
that is a getter as you get what they feel like giving. And, yes, if you ask
them to delete it, if it indeed still exists (or ever existed) they may tell
you it was deleted and then take it for themselves!

So, a property is something abstract that you are not allowed to see or in
any way interact with except through layers that hide things and take it on
faith that it is being done in a way that is good for you, OR ELSE.

Now would your editor understand that?

Disclaimer: I repeat, humor. Others have provided decent answers. But, they
were not necessarily born in a communist country which your parents luckily
took you out of in time!


-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net at python.org> On
Behalf Of Alan Gauld via Python-list
Sent: Sunday, May 30, 2021 4:20 PM
To: python-list at python.org
Subject: Re: Definition of "property"

On 30/05/2021 17:57, Irv Kalb wrote:
> I am doing some writing (for an upcoming book on OOP), and I'm a little
stuck.  

Oh dear, that's one of myt hot buttons I'm afraid!
I hope it really is about OOP and not about classes. Classes are such a
minor part of OOP that it is depressing how many books and articles focus on
them to the exclusion of all else that make up the OOP paradigm! Anyway,
rant over...

> I understand what a "property" is, how it is used and the benefits,

Do you? What is that based on? Is it how properties are used in OOP?
Or how they are used in Python? Is your book truly about OOP or how Python
does OOP (very different things!) How do python properties compare to
properties in other languages like Object Pascal(aka Delphi) and Eiffel for
example?
Which of these 3 options most closely models the pure OOP concept of a
property?

> definition of property.  

In OOP or in Python? Or both?

> A property object has getter, setter, and deleter methods usable as 
> decorators that create a copy of the property with the corresponding 
> accessor function set to the decorated function.

That's a very Pythonic description.

> (I would like to avoid going through the whole derivation with the 
> property function, as that would distract from the points that I am 
> trying to make.)

Which are?
Hopefully, about abstraction of data and function/methods therby encouraging
polymorphic representations of program structures, which is the essence of
OOP.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list