guys, I’m probably not the best person to say this, but I think your discussion in far from being productive.
@espenmn you become a programmer since the very moment you start coding and giving others advice on it.
there are many mistakes in the code you’re proposing, but nothing that can’t be enhanced. first you have to understand some basic concepts: catalog searches always return an iterable of results, always. some specific searches, like the one you’re proposing using the UID of an object, can return an iterable of zero (if no item was found in the catalog with that UID), one (if there’s an item with that UID in the catalog), or even more than one (if you have catalog issues or some objects are inheriting their UID from others). the last possibility is an error that most be fixed.
in Python, errors should never pass silently; so, you want to rise an exception if that’s the case. you can use a simple assertion:
assert len(results) in (0, 1)
that could be fine, but if you are running with optimized code, assertions are ignored; it’s up to you to decide how to deal with that.
now, sets and list are different kind of iterators: a set differs from a list in the sense that it can’t contain duplicated elements. there are many other types of iterators and each one of them is useful in different circumstances. some of them are not mutable, some consume less memory. go to the Python documentation and learn about it.
resuming, you have to be careful and study to become a better programmer. I’ll give you an advice: review other people’s code; you’ll learn a lot from it.
always have in mind that some of our best programmers are not graduated from computer science.
@zopyx relax, you don’t have to be aggressive even if you have lost your patience; you better skip the thread: life goes on.
for me, Plone right now is in a transition; people is spending time fighting against time on the Python 3 migration and we have very limited resources. Plone 6 will probably be much better if we can get rid of the broken parts.
and don’t assume proprietary software is better just because you can’t see the code; open source can be hard, but people will always pay more using proprietary software, and I’m not talking only about money.