Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: [[' ']*3]*3 buggy behavior?
Post: RE: [[' ']*3]*3 buggy behavior?

(Sep-07-2021, 04:26 PM)deanhystad Wrote: Quote:I'm down to trying to understand when an assignment creates a new object vs references an existing object. Gotta do more reading on this subject. Perha...
shadowphile General Coding Help 6 2,985 Sep-07-2021, 05:28 PM
    Thread: [[' ']*3]*3 buggy behavior?
Post: RE: [[' ']*3]*3 buggy behavior?

(Aug-18-2021, 03:35 PM)naughtyCat Wrote: the inner list [[]*3] produces a list of three lists. But then this list is duplicated three times. However, in python, it's really a list of references that...
shadowphile General Coding Help 6 2,985 Aug-18-2021, 07:26 PM
    Thread: 'namespace' shorthand for function arguments?
Post: RE: 'namespace' shorthand for function arguments?

(Aug-10-2021, 08:18 PM)deanhystad Wrote: I understand the concern. By using lots of attributes in an object that was passed in as an argument your updatevalue method becomes strongly tied to the de...
shadowphile General Coding Help 5 2,617 Aug-11-2021, 09:02 PM
    Thread: 'namespace' shorthand for function arguments?
Post: 'namespace' shorthand for function arguments?

(using 3.9) I tried to search for this subject but couldn't find the right wording (typical problem). I have a function I am passing an object with attributes ('hand'). Hand has four attributes and I...
shadowphile General Coding Help 5 2,617 Aug-10-2021, 06:55 PM
    Thread: [[' ']*3]*3 buggy behavior?
Post: RE: [[' ']*3]*3 buggy behavior?

thanks for the reply. I do not normally keep up on all the forum posts but I do try to search for a relevant post. Unfortunately I couldn't even figure out how to find relevant posts. Your answer mak...
shadowphile General Coding Help 6 2,985 Aug-06-2021, 07:40 PM
    Thread: [[' ']*3]*3 buggy behavior?
Post: [[' ']*3]*3 buggy behavior?

Running 3.9.x in Jupyter Notebook I used a shortcut to create 3x3 array, why doesn't it act correctly? brd=[[' ']*3]*3 b=[[' ',' ',' '],[' ',' ',' '],[' ',' ',' ']] print(b==brd) #if these are equiva...
shadowphile General Coding Help 6 2,985 Aug-05-2021, 10:16 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020