News for hackers. Stuff that matters.
Re:Anti-Patterns in Python Programming by sophacles on Wednesday July 09, 2014 @12:25PM (#8010492)
Not the op, but I'd accept the confusion response of: [[]] [[],[]] [[],[],[]]

because the behavior is the same, whether or not they misread an 'l' as a 1.

Re:Anti-Patterns in Python Programming by pyre on Wednesday July 09, 2014 @12:46PM (#8010624)
Python doesn't seem to agree with you :^)

  In [1]: a = []

  In [2]: a.append(a)

  In [3]: a
  Out[3]: [[...]]

  In [4]: a[0]
  Out[4]: [[...]]

  In [5]: a[0][0]
  Out[5]: [[...]]

  In [6]: a[0][0][0]
  Out[6]: [[...]]

  In [7]: a[0][0][0][0]
  Out[7]: [[...]]

  In [8]: a.append(a)

  In [9]: a
  Out[9]: [[...], [...]]

  In [10]: a[0][1][0] is a
  Out[10]: True

  In [11]: id(a)
  Out[11]: 4547140064

  In [12]: id(a[0][1][0])
  Out[12]: 4547140064
Re:Anti-Patterns in Python Programming by sophacles on Wednesday July 09, 2014 @07:22PM (#8012760)
Yeah, the whole infinite loop thing. Wasn't fully thinking when I wrote my reply. Good catch.