{"id":872,"date":"2010-04-06T22:55:53","date_gmt":"2010-04-06T14:55:53","guid":{"rendered":"http:\/\/blog.axqd.net\/?p=872"},"modified":"2010-04-06T22:55:53","modified_gmt":"2010-04-06T14:55:53","slug":"slice-as-a-copy","status":"publish","type":"post","link":"https:\/\/blog.axqd.net\/?p=872","title":{"rendered":"Slice as a copy"},"content":{"rendered":"<p>Fine, I have no choice, but to say I am an outman&#8230; I&#8217;ve no idea that python slice can be used as a copy of the original array, which, of course, can save us a tons of typing.<\/p>\n<p>Again, when I talked about slice, I mean array slice, not immutable\/optimized string slice.<\/p>\n<blockquote><p>&gt;&gt;&gt; a = [ 1, 2, 3 ]<br \/>\n&gt;&gt;&gt; b = a[ : ]<\/p>\n<p>&gt;&gt;&gt; id( a )<br \/>\n12822008<br \/>\n&gt;&gt;&gt; id( b )<br \/>\n17547792<\/p>\n<p>&gt;&gt;&gt; id( a[ 0 ] )<br \/>\n505408872<br \/>\n&gt;&gt;&gt; id( b[ 0 ] )<br \/>\n505408872<\/p><\/blockquote>\n<blockquote><p>&gt;&gt;&gt; a = &#8216;123&#8217;<br \/>\n&gt;&gt;&gt; b = a[ : ]<\/p>\n<p>&gt;&gt;&gt; id( a )<br \/>\n12578656<br \/>\n&gt;&gt;&gt; id( b )<br \/>\n12578656<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Fine, I have no choice, but to say I am an outman&#038;#8230 &hellip; <a href=\"https:\/\/blog.axqd.net\/?p=872\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cSlice as a copy\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[129,139],"class_list":["post-872","post","type-post","status-publish","format-standard","hentry","category-tech","tag-python","tag-slice"],"_links":{"self":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=872"}],"version-history":[{"count":0,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=\/wp\/v2\/posts\/872\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.axqd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}