Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Cody Stephenson8,272 Points
How are we able to update the daily minutes entries in the array after it has been created if arrays are immutable?
The array is created with all zeros in a previous cell - then we are able to change entries by index in a later cell. This seems contrary to arrays being immutable? Or is it strictly the size and datatype that are immutable?
Chris FreemanTreehouse Moderator 68,031 Points
Hey Cody Stephenson, arrays are mutable. There is a
writable flag that can be set to raise an error on a write attempt. The does not stop the ability of previous references to the array from writing to elements.
So a slice created before setting
False, is not blocked. “...locking a base object does not lock any views that already reference it”. See docs under