TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Facts and myths about Python names and values

68 pointsby stakentalmost 12 years ago

5 comments

nslocumalmost 12 years ago
In the Wrapping Up section, there are some very interesting points that weren&#x27;t covered in the article.<p><pre><code> - Why is &quot;list += seq&quot; not the same as &quot;list = list + seq&quot;? - Why is &quot;is&quot; different than &quot;==&quot; and how come &quot;2 + 2 is 4&quot;, but &quot;1000 + 1 is not 1001&quot;? - What&#x27;s the deal with mutable default arguments to functions? - Why is it easy to make a list class attribute, but hard to make an int class attribute? </code></pre> I&#x27;d love to read an article on these topics. Anyone have links?
评论 #6042097 未加载
评论 #6041612 未加载
评论 #6041668 未加载
评论 #6041345 未加载
topherjaynesalmost 12 years ago
Ned always has fantastic articles, and the way this is lays out the mutable values name relationship, is it just lazy programming that has multiple names pointing to the same mutable value(s) or are their specific cases when that would make since to have list(a) list(b) point to the same value(s)?
评论 #6043603 未加载
TazeTSchnitzelalmost 12 years ago
JavaScript works identically.
B-Conalmost 12 years ago
Personally, THIS is what an &quot;intro to language X&quot; article should look like. It walks you through how the language thinks, which is one of the things you need to learn in order to understand how to best use it and why things are the way they are.
lubomiralmost 12 years ago
The vizualizations on pythontutor.com are really helpful in explaining those concepts.