On Sat, Feb 9, 2013 at 3:24 AM, Alan Gauld wrote:
> On 09/02/13 07:01, neubyr wrote:
>
>>
>> I am learning Python 2.7 classes and objects. It seems like attributes
>> (data attributes and methods) can be added to a class/object even after
>> it's first declaration. For example,
>>
>
> You can do
On 09/02/13 07:01, neubyr wrote:
I am learning Python 2.7 classes and objects. It seems like attributes
(data attributes and methods) can be added to a class/object even after
it's first declaration. For example,
You can do that, but mostly you shouldn't.
Usually when classes/objects are use
On 09/02/13 18:01, neubyr wrote:
I understand that all attributes are stored in a dictionary, but I am not
following when adding an attribute after initial declaration approach
should be used. The official documentation also suggests that valid
attributes are all the names present when the class
On 02/09/2013 02:01 AM, neubyr wrote:
> I am learning Python 2.7 classes and objects. It seems like
attributes (data attributes and methods) can be added to a class/object
even after it's first declaration. For example,
>
>
> class A(object):
> def __init__(self,arg):
> self.val1 = arg
>
> a
I am learning Python 2.7 classes and objects. It seems like attributes
(data attributes and methods) can be added to a class/object even after
it's first declaration. For example,
class A(object):
def __init__(self,arg):
self.val1 = arg
a = A(1)
print a.val1
Now another data attribute v