Greg Ewing ezt írta (időpont: 2021. jún. 2.,
Sze, 4:01):
> On 1/06/21 7:01 am, Alan Gauld wrote:
> > That was the point, the OP said it was a book about OOP.
> > Not a book about "OOP in Python".
>
> In that case it would be best to avoid the word, or give
> a definition of the way he's using
On 1/06/21 7:01 am, Alan Gauld wrote:
That was the point, the OP said it was a book about OOP.
Not a book about "OOP in Python".
In that case it would be best to avoid the word, or give
a definition of the way he's using it, making it clear
that it's not a universal definition. Python's
On 31/05/2021 15:59, Dennis Lee Bieber wrote:
> On Sun, 30 May 2021 21:20:24 +0100, Alan Gauld via Python-list
> declaimed the following:
>
>> 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
On 6/1/21, Jon Ribbens via Python-list wrote:
>
> I already answered that in the post you are responding to, but you
> snipped it: You can tell something's definitely not a data attribute
> if you have to put brackets after its name to call it as a method to
> invoke its function or retrieve the
On 2021-06-01, Greg Ewing wrote:
> On 1/06/21 2:34 am, Jon Ribbens wrote:
>> From the outside, it's just a *data* attribute. Which, from the inside,
>> it isn't. Hence "pretending".
>
> But what is it about the external appearance that would make
> you think it's a data attribute, rather than
On 1/06/21 2:34 am, Jon Ribbens wrote:
From the outside, it's just a *data* attribute. Which, from the inside,
it isn't. Hence "pretending".
But what is it about the external appearance that would make
you think it's a data attribute, rather than some other kind
of attribute?
(I'm assuming
On 31/05/2021 01:24, Greg Ewing wrote:
> On 31/05/21 8:20 am, Alan Gauld wrote:
>>
>> That's a very Pythonic description.
>
> If it's a book about Python, it needs to be. The word "property"
> has a very specialised meaning in Python.
>
> In some other languages it's used the way we use
On 2021-05-31, Greg Ewing wrote:
> On 31/05/21 9:13 am, Jon Ribbens wrote:
>> No, I said it pretends to be a *data* attribute.
>
> I don't think it's pretending to be anything. From the outside,
> it's just an attribute.
>From the outside, it's just a *data* attribute. Which, from the inside,
it
y
>> editor. The editor is asking for a definition of property. I've
>> looked at many articles on line and a number of books, and I haven't
>> found an appropriate one yet.
>>
>> I have written some good examples of how it works, but I agree that a
>> definition up front
On 31/05/21 9:13 am, Jon Ribbens wrote:
No, I said it pretends to be a *data* attribute.
I don't think it's pretending to be anything. From the outside,
it's just an attribute.
Data attributes are more common than non-data attributes, so
we tend to assume that an attribute is a data attribute
.
That's not a definition of a property -- it's talking about a
mechanism that provides one way of creating a property, using
decorators. DON'T quote that as a definition!
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 31/05/21 8:20 am, Alan Gauld wrote:
That's a very Pythonic description.
If it's a book about Python, it needs to be. The word "property"
has a very specialised meaning in Python.
In some other languages it's used the way we use "attribute" in
Python. So a Python-specific definition is
On 30/05/2021 23:57, Mike Dewhirst wrote:
>
> A property is an object method masquerading as a cachable object attribute
Or a group of methods perhaps?
--
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
On 2021-05-30, Terry Reedy wrote:
> Note: at least one person says a property *pretends* to be an attribute.
No, I said it pretends to be a *data* attribute. It is effectively
several methods in a trenchcoat pretending to be a variable.
--
https://mail.python.org/mailman/listinfo/python-list
On 5/30/21, Ethan Furman wrote:
>
> > Properties are a special kind of attribute. Basically, when Python
> encounters the following code:
> >
> > spam = SomeObject()
> > print(spam.eggs)
> >
> > it looks up eggs in spam, and then examines eggs to see if it has a
> __get__, __set__,
-list On
Behalf Of Alan Gauld via Python-list
Sent: Sunday, May 30, 2021 4:20 PM
To: python-list@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 o
r my editor.
> The editor is asking for a definition of property. I've looked at many
> articles on line and a number of books, and I haven't found an appropriate
> one yet.
>
> I have written some good examples of how it works, but I agree that a
> definition up front would
is
asking for a definition of property. I've looked at many articles on line and a number
of books, and I haven't found an appropriate one yet.
I have written some good examples of how it works, but I agree that a
definition up front would be helpful. I have tried a number of times, but my
attempts
my editor.
> The editor is asking for a definition of property. I've looked at many
> articles on line and a number of books, and I haven't found an appropriate
> one yet.
>
> I have written some good examples of how it works, but I agree that a
> definition up front would be helpf
ython? 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?
>
is
asking for a definition of property. I've looked at many articles on line and a number
of books, and I haven't found an appropriate one yet.
I have written some good examples of how it works, but I agree that a
definition up front would be helpful. I have tried a number of times, but my
attempts
On 2021-05-30, Irv Kalb wrote:
> I understand what a "property" is, how it is used and the benefits,
> but apparently my explanation hasn't made the light bulb go on for my
> editor. The editor is asking for a definition of property. I've
> looked at many articles on line
On 5/30/21 9:57 AM, Irv Kalb wrote:
> I understand what a "property" is, how it is used and the benefits, but apparently my explanation hasn't made the
light bulb go on for my editor.
My answer from Stackoverflow [1]:
> Properties are a special kind of attribute. Basically, when Python
light bulb go on for my editor.
> The editor is asking for a definition of property. I've looked at many
> articles on line and a number of books, and I haven't found an appropriate
> one yet.
>
> I have written some good examples of how it works, but I agree that a
> definition
bulb go on for my editor.
> The editor is asking for a definition of property. I've looked at many
> articles on line and a number of books, and I haven't found an appropriate
> one yet.
>
> I have written some good examples of how it works, but I agree that a
> definition up front would
I am doing some writing (for an upcoming book on OOP), and I'm a little stuck.
I understand what a "property" is, how it is used and the benefits, but
apparently my explanation hasn't made the light bulb go on for my editor. The
editor is asking for a definition of property. I
26 matches
Mail list logo