Re: [Tutor] lists of lists: more Chutes Ladders!

2014-01-01 Thread Danny Yoo
My point was: `iter` the func exists in python (built-in with '-'), one may use it at times. Giving an application var this name hides, which accosionnally leads to bugs. I have been bitten by such a bug more than once in the past, and once hard to find, asp. with the built-in func `range` (a

Re: [Tutor] lists of lists: more Chutes Ladders!

2014-01-01 Thread Mark Lawrence
On 01/01/2014 08:04, Danny Yoo wrote: My point was: `iter` the func exists in python (built-in with '-'), one may use it at times. Giving an application var this name hides, which accosionnally leads to bugs. I have been bitten by such a bug more than once in the past, and once hard to find,

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread Mark Lawrence
On 31/12/2013 07:30, Keith Winston wrote: Never mind, I figured out that the slice assignment is emptying the previous lists, before the .reset() statements are creating new lists that I then populate and pass on. It makes sense. On Tue, Dec 31, 2013 at 12:59 AM, Keith Winston

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread spir
On 12/31/2013 06:59 AM, Keith Winston wrote: I resolved a problem I was having with lists, but I don't understand how! I caught my code inadvertently resetting/zeroing two lists TWICE at the invocation of the game method, and it was leading to all the (gamechutes gameladders) lists returned by

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread Keith Winston
Thanks Denis, I found out about the iter builtin last night, a few hours after I'd coded/posted that. Oops. Thanks for your other comments, I am clearer now about the distinction of creating a new, empty list vs. clearing the same list out, and the subsequent implications on other symbols bound to

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread spir
On 12/31/2013 09:46 PM, Keith Winston wrote: Thanks Denis, I found out about the iter builtin last night, a few hours after I'd coded/posted that. Oops. Thanks for your other comments, I am clearer now about the distinction of creating a new, empty list vs. clearing the same list out, and the

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread eryksun
On Tue, Dec 31, 2013 at 4:27 AM, spir denis.s...@gmail.com wrote: In addition, iter is also the name of a builtin function, like print. While iter is a built-in function, it would be clearer if you referenced the __builtins__ namespace. Built-in objects are linked into the interpreter, either

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread Steven D'Aprano
On Tue, Dec 31, 2013 at 10:00:32PM -0500, eryksun wrote: On Tue, Dec 31, 2013 at 4:27 AM, spir denis.s...@gmail.com wrote: In addition, iter is also the name of a builtin function, like print. While iter is a built-in function, it would be clearer if you referenced the __builtins__

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread eryksun
On Tue, Dec 31, 2013 at 10:53 PM, Steven D'Aprano st...@pearwood.info wrote: __builtins__ with-an-s is a crappy hack that has never worked correctly and has caused more confusion than help: https://mail.python.org/pipermail/python-3000/2007-March/006170.html Restricted mode in CPython has

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-31 Thread spir
On 01/01/2014 07:13 AM, eryksun wrote: I'm afraid I've lost the context, and don't understand why this is important. It's true that not all built-in objects are in builtins, and not all objects in builtins are built-in, but other than for pedantic correctness, why does this matter? Denis said:

[Tutor] lists of lists: more Chutes Ladders!

2013-12-30 Thread Keith Winston
I resolved a problem I was having with lists, but I don't understand how! I caught my code inadvertently resetting/zeroing two lists TWICE at the invocation of the game method, and it was leading to all the (gamechutes gameladders) lists returned by that method being zeroed out except the final

Re: [Tutor] lists of lists: more Chutes Ladders!

2013-12-30 Thread Keith Winston
Never mind, I figured out that the slice assignment is emptying the previous lists, before the .reset() statements are creating new lists that I then populate and pass on. It makes sense. On Tue, Dec 31, 2013 at 12:59 AM, Keith Winston keithw...@gmail.com wrote: I resolved a problem I was