Python - inner class is not defined? -


i have unrolled linked list 1 of classes. i'm new python, not programming, , reason cannot around little problem!

i have class node node object used within unrolled linked list. unrolled linked list class performs operations on node class.

class unrolledlinkedlist(object):      """ inner node class """     class node(object):         def __init__(self):             self.array = []             self.next_node = none     """ end node class """      def __init__(self, max_node_capacity=16):         self.max_node_capacity = max_node_capacity         self.head = node()       """ other functions of unrolledlinkedlist class """ 

the problem comes @ last line of unrolledlinkedlist class' init function: "global name node not defined". double checked indentation , looked on internet examples of this, couldn't find any. mind explaining me what's wrong?

methods do not include class scope searched. if want work need use either unrolledlinkedlist.node or self.node instead.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -