<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Megumi221</author_name>
  <author_url>https://blog.hatena.ne.jp/Megumi221/</author_url>
  <blog_title>理想のユーザ・インターフェイスを求めて</blog_title>
  <blog_url>https://ideal-user-interface.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>0と-1からなるリストがあって、そのリストに-1が含まれる場合には、なんらかの処理を行う必要があるとする。 例えば、flist = [0, -1, 0, 0] のようなリストがある。 最初にやっていたこと。 tmp = flist tmp.sort() if tmp[0] == -1: # -1を含む場合の処理 ... else: # 0だけからなるときの処理 ... これだと、条件判定はきちんとできるのだが、sortした後だと、flist=[-1, 0, 0, 0]になってしまう。一時的にtmpにリストを代入して順番を変えたいだけだったのに、flistの方もsortされたリストになってしまう…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fideal-user-interface.hatenablog.com%2Fentry%2F20110228%2F1298863180&quot; title=&quot; リストのsortは注意が必要だと気づく - 理想のユーザ・インターフェイスを求めて&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-02-28 12:19:40</published>
  <title> リストのsortは注意が必要だと気づく</title>
  <type>rich</type>
  <url>https://ideal-user-interface.hatenablog.com/entry/20110228/1298863180</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
