On Jun 3, 12:59 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote:
>
>
>
> > Hello all,
>
> > I have come across this issue in Python and I cannot quite understand
> > what is going on.
>
> > class Param():
> > def __init__(self, data={}, condition=False)
Changing the default for data to None and creating a new dict inside your
function might handle this. But I don't know what it is you want. It never
even occurred to me that this behavior might be desired in the first place.
class Param(object):
def __init__(self,data=None,condition=False):
On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote:
> Hello all,
>
> I have come across this issue in Python and I cannot quite understand
> what is going on.
>
> class Param():
> def __init__(self, data={}, condition=False):
> if condition:
> data['class']="Advanced"
> pri
On Jun 3, 6:11 pm, [EMAIL PROTECTED] wrote:
> Hello all,
>
> I have come across this issue in Python and I cannot quite understand
> what is going on.
>
> class Param():
> def __init__(self, data={}, condition=False):
> if condition:
> data['class']="Advanced"
> prin
Hello all,
I have come across this issue in Python and I cannot quite understand
what is going on.
class Param():
def __init__(self, data={}, condition=False):
if condition:
data['class']="Advanced"
print data
In the previous example, I expect the variable data to