Closed CNSeniorious000 closed 4 months ago
I read #251 and think that using is operator to identify objects may fix the problem id brings.
is
id
For now, you can:
BoxList
>>> from box import BoxList >>> a = [] >>> a.append(a) >>> a [[...]] >>> b = BoxList(a) >>> b BoxList([[...]]) >>> b[0][0][0][0] is b True
>>> a = BoxList() >>> a BoxList([]) >>> a.append(a) >>> a BoxList([[...]]) >>> a[0][0][0][0] is a True
Note this:
>>> a = [] >>> b = BoxList(a) >>> b.append(a) >>> b BoxList([[]]) >>> b[0] is a False
This is because:
iterable
__init__
a
b
I have no idea how this fell off my radar, I apologize!
Thank you so much for looking into this!
I read #251 and think that using
is
operator to identify objects may fix the problemid
brings.For now, you can:
BoxList
with a list with circular referencesNote this:
This is because:
iterable
passing to__init__
.a
is not the same asb
anymore, I think users appendingb
toa
is not intended to appenda
toa
.