File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,13 @@ def len(self):
6767 return 0
6868
6969 def get (self , idx ):
70- if self .__data_list__ is None :
71- self .__data_list__ = self .len () * [None ]
72- else :
73- data = self .__data_list__ [idx ]
74- if data is not None :
75- return copy .copy (data )
70+ if hasattr (self , '__data_list__' ):
71+ if self .__data_list__ is None :
72+ self .__data_list__ = self .len () * [None ]
73+ else :
74+ data = self .__data_list__ [idx ]
75+ if data is not None :
76+ return copy .copy (data )
7677
7778 data = self .data .__class__ ()
7879 if hasattr (self .data , '__num_nodes__' ):
@@ -90,7 +91,9 @@ def get(self, idx):
9091 s = slice (start , end )
9192 data [key ] = item [s ]
9293
93- self .__data_list__ [idx ] = copy .copy (data )
94+ if hasattr (self , '__data_list__' ):
95+ self .__data_list__ [idx ] = copy .copy (data )
96+
9497 return data
9598
9699 @staticmethod
You can’t perform that action at this time.
0 commit comments