Re: Explanation of list reference

2014-02-14 Thread Steven D'Aprano
On Fri, 14 Feb 2014 22:20:35 -0700, Ian Kelly wrote: > On Fri, Feb 14, 2014 at 9:24 PM, Rustom Mody > wrote: >> In the case of physical objects like dice there is a fairly >> unquestionable framing that makes identity straightforward -- >> 4-dimensional space-time coordiantes. If the space-time c

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 5:44 PM, Steven D'Aprano wrote: > You just need to recognise that > objects can contain themselves: > > py> L = [] > py> L.append(L) > py> L in L > True > > > Of course, if you are a fan of the Doctor Who television show, you won't > be concerned by this. If the TARDIS can

Re: Explanation of list reference

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 5:54 PM, Steven D'Aprano wrote: > On Sat, 15 Feb 2014 15:37:20 +1100, Chris Angelico wrote: > > [...] >> This is why dice exist in a variety of colors [1]. Indistinguishable yet >> distinct dice... > > Since they have different colours, they can be distinguished and aren't

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Ian Kelly
On Fri, Feb 14, 2014 at 8:31 PM, Nick Timkovich wrote: > OK, now the trick; adding `data = None` inside the generator works, but in > my actual code I wrap my generator inside of `enumerate()`, which seems to > obviate the "fix". Can I get it to play nice or am I forced to count > manually. Is th

Re: Generator using item[n-1] + item[n] memory

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 6:27 PM, Ian Kelly wrote: > On Fri, Feb 14, 2014 at 8:31 PM, Nick Timkovich > wrote: >> OK, now the trick; adding `data = None` inside the generator works, but in >> my actual code I wrap my generator inside of `enumerate()`, which seems to >> obviate the "fix". Can I ge

<    1   2