Just a guess, but I would expect that
As a side note PEP8 recommendation:
QgsProject.instance().layoutManager().layouts()[0].items()
would return some kind of iterable of 2-element tuples (e.g. like dict.items()) in this case l
would not be an instance of QgsLayoutItemLabel
.As a side note PEP8 recommendation:
Quote:Names to Avoid
Never use the characters 'l' (lowercase letter el), 'O' (uppercase letter oh), or 'I' (uppercase letter eye) as single character variable names.
In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs