Re: implementing descriptors

2009-08-15 Thread Raymond Hettinger
> Raymond, >    This functionality is exactly what I was looking for. Thanks!  I'll > be using this to solve my problem. > >    Now that I'm on the right track, I'm still a bit confused about how > __get__ and __set__ are useful.  Admittedly, I don't need to > understand them to solve this problem,

Re: implementing descriptors

2009-08-14 Thread Terry Reedy
dippim wrote: will say that as this particular requirement is imposed on this class by the writer, shouldn't it be the writer's responsibility to enforce it, especially, when the cost of enforcement is so low? I would say that it is the writer's responsibility to set the requirement and be cl

Re: implementing descriptors

2009-08-14 Thread Ethan Furman
dippim wrote: On Aug 14, 10:48 am, Dave Angel wrote: dippim wrote: On Aug 14, 2:34 am, Raymond Hettinger wrote: [David] I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in

Re: implementing descriptors

2009-08-14 Thread Dave Angel
dippim wrote: On Aug 14, 10:48 am, Dave Angel wrote: dippim wrote: On Aug 14, 2:34 am, Raymond Hettinger wrote: [David] I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain th

Re: implementing descriptors

2009-08-14 Thread dippim
On Aug 14, 10:48 am, Dave Angel wrote: > dippim wrote: > > On Aug 14, 2:34 am, Raymond Hettinger wrote: > > >> [David] > > >>> I am new to Python and I have a question about descriptors.  If I have > >>> a class as written below, is there a way to use descriptors to be > >>> certain that the date

Re: implementing descriptors

2009-08-14 Thread dippim
On Aug 14, 10:48 am, Dave Angel wrote: > dippim wrote: > > On Aug 14, 2:34 am, Raymond Hettinger wrote: > > >> [David] > > >>> I am new to Python and I have a question about descriptors.  If I have > >>> a class as written below, is there a way to use descriptors to be > >>> certain that the date

Re: implementing descriptors

2009-08-14 Thread Dave Angel
dippim wrote: On Aug 14, 2:34 am, Raymond Hettinger wrote: [David] I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in start is always before the one in end? clas

Re: implementing descriptors

2009-08-14 Thread dippim
On Aug 14, 2:34 am, Raymond Hettinger wrote: > [David] > > > > > I am new to Python and I have a question about descriptors.  If I have > > a class as written below, is there a way to use descriptors to be > > certain that the datetime in start is always before the one in end? > > > class foo(obje

Re: implementing descriptors

2009-08-14 Thread Diez B. Roggisch
dippim schrieb: On Aug 14, 5:45 am, Jean-Michel Pichavant wrote: Emile van Sebille wrote: On 8/13/2009 3:17 PM dippim said... I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in s

Re: implementing descriptors

2009-08-14 Thread dippim
On Aug 14, 5:45 am, Jean-Michel Pichavant wrote: > Emile van Sebille wrote: > > On 8/13/2009 3:17 PM dippim said... > >> I am new to Python and I have a question about descriptors.  If I have > >> a class as written below, is there a way to use descriptors to be > >> certain that the datetime in s

Re: implementing descriptors

2009-08-14 Thread Jean-Michel Pichavant
Emile van Sebille wrote: On 8/13/2009 3:17 PM dippim said... I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in start is always before the one in end? class foo(object): def __i

Re: implementing descriptors

2009-08-13 Thread Raymond Hettinger
[David] > I am new to Python and I have a question about descriptors.  If I have > a class as written below, is there a way to use descriptors to be > certain that the datetime in start is always before the one in end? > > class foo(object): >    def __init__(self,a = None,b = None) >       self.st

Re: implementing descriptors

2009-08-13 Thread Emile van Sebille
On 8/13/2009 3:17 PM dippim said... I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in start is always before the one in end? class foo(object): def __init__(self,a = None,b = No

Re: implementing descriptors

2009-08-13 Thread Mark Lawrence
dippim wrote: I am new to Python and I have a question about descriptors. If I have a class as written below, is there a way to use descriptors to be certain that the datetime in start is always before the one in end? class foo(object): def __init__(self,a = None,b = None) self.start =