• @JasonDJ@lemmy.zip
    link
    fedilink
    English
    81 month ago

    if isinstance(mylist, list) and not mylist

    Problem solved.

    Or if not mylist # check if list is empty

      • @JasonDJ@lemmy.zip
        link
        fedilink
        English
        11 month ago

        Doesn’t Python treat all empty iterables as false tho? This isn’t unique to python, is it? (though I’m not a programmer…just a dude who writes scripts every now and then)