neubyr wrote:
> Thank you for your comments Steven.
>
> Yes, I think I should remove property deleter in this case.
>
> I would like to use this Person class in another class. For example, if
> Person class is 'model' in a
> small MVC-style web application, then where should I place my validatio
On Fri, Feb 22, 2013 at 10:31 PM, Steven D'Aprano wrote:
> On 23/02/13 10:50, neubyr wrote:
>
>> I would like to validate data attributes before the object is instantiated
>> or any changes thereafter. For example, following is a simple Person class
>> with name and age attributes. I would like to
On 23/02/13 10:50, neubyr wrote:
I would like to validate data attributes before the object is instantiated
or any changes thereafter. For example, following is a simple Person class
with name and age attributes. I would like to validate whether age is an
integer before it is added/changed in the
On 02/22/2013 09:26 PM, Robert Sjoblom wrote:
I would like to validate data attributes before the object is instantiated
or any changes thereafter. For example, following is a simple Person class
with name and age attributes. [snip] Following is my
example code:
class Person(object):
def __
> I would like to validate data attributes before the object is instantiated
> or any changes thereafter. For example, following is a simple Person class
> with name and age attributes. [snip] Following is my
> example code:
> class Person(object):
> def __init__(self,name,age):
> self.name
I would like to validate data attributes before the object is instantiated
or any changes thereafter. For example, following is a simple Person class
with name and age attributes. I would like to validate whether age is an
integer before it is added/changed in the object's dictionary. I have taken