Re: [Tutor] @property vs @classmethod

2017-07-08 Thread Cameron Simpson
On 08Jul2017 16:03, Evuraan wrote: I was hoping to learn when to use classmethod and when to use property. They both seem similar (to me at least..), what's the pythonic way to choose between them? The core distinction is the context that the function needs. Does it depend on the particular i

Re: [Tutor] @property vs @classmethod

2017-07-08 Thread Mats Wichmann
On 07/08/2017 06:56 PM, Steven D'Aprano wrote: > The pythonic way is not to use them at all. > > For experts only: you'll know when you need them. > > They really aren't even a little bit similar, if you thought they did > that just means that you haven't understood what they do. > > property

Re: [Tutor] @property vs @classmethod

2017-07-08 Thread Steven D'Aprano
On Sat, Jul 08, 2017 at 04:03:24PM -0700, Evuraan wrote: > Greetings! > > I was hoping to learn when to use classmethod and when to use property. > They both seem similar (to me at least..), what's the pythonic way to > choose between them? The pythonic way is not to use them at all. For experts

Re: [Tutor] @property vs @classmethod

2017-07-08 Thread Alan Gauld via Tutor
On 09/07/17 00:03, Evuraan wrote: > I was hoping to learn when to use classmethod and when to use property. > They both seem similar (to me at least..), what's the pythonic way to > choose between them? In fact they do completely different things. A property is a field of an object that you acce

[Tutor] @property vs @classmethod

2017-07-08 Thread Evuraan
Greetings! I was hoping to learn when to use classmethod and when to use property. They both seem similar (to me at least..), what's the pythonic way to choose between them? $ cat ./try.py #!/usr/bin/python3 class _someclass: _tag = "sometag" def __init__(self,_text): self._text

[Tutor] Comparing images, was Re: principal question

2017-07-08 Thread Peter Otten
marcus lütolf wrote: > dear experts, > before I start digging into writing code I'd like your opinion: > > Is it possible Yes. Now what? > to have python compare 2 subsequent *.jpg images in > subtracting the pixel values of the second from the first image. > If the images and are identica

Re: [Tutor] principal question

2017-07-08 Thread Alan Gauld via Tutor
On 08/07/17 09:05, marcus lütolf wrote: > Is it possible to have python compare 2 subsequent *.jpg images > in subtracting the pixel values of the second from the first image. Yes > If the images and are identical the result should be 0 and the first > image could be deletet. That's possibl

[Tutor] principal question

2017-07-08 Thread marcus lütolf
dear experts, before I start digging into writing code I'd like your opinion: Is it possible to have python compare 2 subsequent *.jpg images in subtracting the pixel values of the second from the first image. If the images and are identical the result should be 0 and the first image could b