On 10/14/22 16:25, DFS wrote: > --------------------------------------------------------------------- > this does a str() conversion in the loop > --------------------------------------------------------------------- > for i in range(cells.count()): > if text == str(ID): > break > > > --------------------------------------------------------- > this does one str() conversion before the loop > --------------------------------------------------------- > strID = str(ID) > for i in range(cells.count()): > if text == strID: > break > > > But does CPython interpret the str() conversion away and essentially do > it for me in the first example?
No. You can use the dis module to show you what CPython is doing under the hood. -- https://mail.python.org/mailman/listinfo/python-list