bytest's recent timeline updates
bytest

bytest

V2EX member #207874, joined on 2016-12-27 15:36:37 +08:00
  •   You need to sign in to view this topic
    bytest's recent replies
    Dec 27, 2016
    Replied to a topic by bytest › Python › 关于 python 里的值传递
    @zmj1316 你是说 STL algorithm 库里的 for_each ,还是 c++11 的 range for loop ?这是两个概念。这里问题的关键在于 python 里的“=”赋值的问题。
    Dec 27, 2016
    Replied to a topic by bytest › Python › 关于 python 里的值传递
    @WKPlus
    @tonghuashuai
    谢谢二位。我知道可变和不可变对象的概念。

    自己想明白了,一直以为是 for 处理不同类型有区别,其实这里的关键在于“=”, append 方法修改了引用的对象,即列表中的列表,而“=”是重新绑定引用对象了。我试了第二个循环里如果写成 i = ['end'],原二维列表也不变了。
    Dec 27, 2016
    Replied to a topic by bytest › Python › 关于 python 里的值传递
    @crab 我知道……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3911 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 17ms · UTC 10:06 · PVG 18:06 · LAX 03:06 · JFK 06:06
    ♥ Do have faith in what you're doing.