News for hackers. Stuff that matters.
Re:Python built-ins worth learning (2019) by saila on Wednesday March 30, 2022 @12:39AM (#30851537)
This is incorrect, because you can generally do this for sequence types:

    isinstance(items, Sequence)
Or perhaps:

    isinstance(items, Iterable)  # works with numpy arrays
Or, equivalent to using len() for type checking, you could do:

    isinstance(items, Sized)

There are no comments on this comment yet.