On Wed, Apr 19, 2017 at 10:19 AM, Peter Otten <__pete...@web.de> wrote:
> Steven D'Aprano wrote:
>
>> As I said, I haven't had a chance to try Peter's code, so it's possible
>> that he's solved all these problems. I'm judging by previous
>
> No, my simple code only "works" for read-only properties
On 19/04/17 08:43, Alan Gauld via Tutor wrote:
> Probably because it is such a rare use case and because
> its not that hard to do yourself if you really need it.
Having read Steven's post I'll retract the bit about
it being not that hard! :-)
But I still think its a fairly rare scenario. Until
Steven D'Aprano wrote:
> As I said, I haven't had a chance to try Peter's code, so it's possible
> that he's solved all these problems. I'm judging by previous
No, my simple code only "works" for read-only properties and only as long as
you don't overwrite the property by assigning to the attrib
On Wed, Apr 19, 2017 at 09:28:26AM +0200, Thomas Güttler wrote:
[code for a classproperty]
> Nice, if it is that simple.
>
> Is there a reason why this is not in the standard library?
I haven't had a chance to test Peter's classproperty code yet, but I
don't expect it to be that simple. People
On 19/04/17 08:28, Thomas Güttler wrote:
> Nice, if it is that simple.
>
> Is there a reason why this is not in the standard library?
Probably because it is such a rare use case and because
its not that hard to do yourself if you really need it.
But the standard library, like any open source pr
Am 18.04.2017 um 13:17 schrieb Peter Otten:
Thomas Güttler wrote:
I would like to have read-only class properties in Python.
I found this
http://stackoverflow.com/questions/128573/using-property-on-classmethods
But there are a lot of discussions of things which I don't understand.
I want to b
On 04/18/2017 04:00 AM, Thomas Güttler wrote:
> I would like to have read-only class properties in Python.
>
> I found this
> http://stackoverflow.com/questions/128573/using-property-on-classmethods
> But there are a lot of discussions of things which I don't understand.
>
> I want to be a user o
On 18/04/17 11:00, Thomas Güttler wrote:
> I would like to have read-only class properties in Python.
Is there a specific reason why? Do you think for example
that users of the class will deliberately try to modify
the attribute? Normally in Python we leave all attributes
public and unprotected (p
Thomas Güttler wrote:
> I would like to have read-only class properties in Python.
>
> I found this
> http://stackoverflow.com/questions/128573/using-property-on-classmethods
> But there are a lot of discussions of things which I don't understand.
>
> I want to be a user of class properties, not
I would like to have read-only class properties in Python.
I found this
http://stackoverflow.com/questions/128573/using-property-on-classmethods
But there are a lot of discussions of things which I don't understand.
I want to be a user of class properties, not an implementer of the details.
I
10 matches
Mail list logo