<div dir="ltr"><div class="gmail_signature"><div dir="ltr"><div dir="ltr">Hello,</div><div dir="ltr"><br></div><div dir="ltr">I found a possible bug with ttk.Treeview widget. </div><div dir="ltr">I'm working on program that uses tkinter UI. I use ttk.Treeview to display some objects and I want to use integer iid of items.</div><div dir="ltr">For example, I insert a row with treeview.insert(... iid=0, ...). But I encountered a problem when I try to get this item from treeview by iid when iid =0.</div><div dir="ltr">There is no item with such iid. This item has autogenerated iid just like it's not specified.</div><div dir="ltr">I investigated problem and found that in ttk.py, Treeview.insert(... iid=None, ...) in method's body has a check:</div><div dir="ltr">        if iid:</div><div dir="ltr">            res = self.tk.call(self._w, "insert", parent, index,</div><div dir="ltr">                "-id", iid, *opts)</div><div dir="ltr">        else:</div><div dir="ltr">            res = self.tk.call(self._w, "insert", parent, index, *opts)</div><div dir="ltr">It means that if iid is "True" then use it else autogenerate it.</div><div dir="ltr">Maybe there should be "if iid is not None", not "if iid"? Or there are some reasons to do check this way?</div><div dir="ltr"><br></div><div dir="ltr">Igor Yakovchenko</div></div></div>
</div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid #d3d4de">
        <tr>
      <td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Без вирусов. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.ru</a>                 </td>
        </tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>