Avoid the NULL (None, nil, whatever) and return an empty array/list/collection/container/object/sequence/set/etc/etc instead. It can pass transparently through the same logic (loop), as though it were populated, but it will effectively break past the loop at its initial conditional test (the while/for condition). This eliminates the necessity for additional code which checks for nulls and it allows the caller to cleanly separate, and focus solely on, their own concerns.
Смотрите видео No Nulls -🤪- Use An Empty! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь veganaiZe 24 Октябрь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 32 раз и оно понравилось like людям.