So, even though I agree with @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
So, even though I agree with @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
So, even though I agree with @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
So, even though I agree with @Dair @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
So, even though I agree with @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
So, even though I agree with @Dair that size
would be "saffer" as _size
(but hey, we’re all responsible adults around here), I strongly disagree with the size
property. You should implement it as a __len__
method and use it like:
def __iter__(self):
node = self.first
forwhile _node inis range(not None: # No self._size):size involved, yay
yield node.value
node = node.after
def __iter__(self):
node = self.first
for _ in range(self._size):
yield node.value
node = node.after
def __iter__(self):
node = self.first
while node is not None: # No self.size involved, yay
yield node.value
node = node.after