Scope of a class..help???

2013-05-23 Thread lokeshkoppaka
i had written the following code i am unable to create the instance of the class Node in the method number_to_LinkedList can any one help me how to do ?? and what is the error?? class Node: def __init__(self, value=None): self.value = value self.next = None def

Re: Scope of a class..help???

2013-05-23 Thread Chris Angelico
On Thu, May 23, 2013 at 7:51 PM, lokeshkopp...@gmail.com wrote: i had written the following code i am unable to create the instance of the class Node in the method number_to_LinkedList can any one help me how to do ?? and what is the error?? It would really help if you post the actual

Re: Scope of a class..help???

2013-05-23 Thread Peter Otten
lokeshkopp...@gmail.com wrote: i had written the following code i am unable to create the instance of the class Node in the method number_to_LinkedList can any one help me how to do ?? and what is the error?? class Node: def __init__(self, value=None): self.value = value

Re: Scope of a class..help???

2013-05-23 Thread lokeshkoppaka
Thanks Chris Angelico, i am new to python can you suggest me how to remove the error and solve it. so,how can i create an instance for Node in that function??,is, it not possible to create an instance in such a way? -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope of a class..help???

2013-05-23 Thread Chris Angelico
On Thu, May 23, 2013 at 8:23 PM, lokeshkopp...@gmail.com wrote: Thanks Chris Angelico, i am new to python can you suggest me how to remove the error and solve it. so,how can i create an instance for Node in that function??,is, it not possible to create an instance in such a way? The

Re: Scope of a class..help???

2013-05-23 Thread lokeshkoppaka
ok Peter Otten, but how to make a Class global?? -- http://mail.python.org/mailman/listinfo/python-list

Re: Scope of a class..help???

2013-05-23 Thread Chris Angelico
On Thu, May 23, 2013 at 8:25 PM, lokeshkopp...@gmail.com wrote: ok Peter Otten, but how to make a Class global?? He gave some examples. It'd be helpful to quote some of his post, for context... and preferably, show some proof that you've understood it. You're starting a number of threads that

Re: Scope of a class..help???

2013-05-23 Thread Tim Roberts
lokeshkopp...@gmail.com wrote: ok Peter Otten, but how to make a Class global?? Your class IS global. I still don't think you understand what you did wrong. You've tripped into a strange little quirk of scoping. Here is your code with some unimportant lines removes. class Node: def