playbook/antigravity-awesome-skills/skills/loki-mode/benchmarks/results/2026-01-05-00-49-17/humaneval-solutions/22.py

11 lines
349 B
Python

from typing import List, Any
def filter_integers(values: List[Any]) -> List[int]:
""" Filter given list of any python values only for integers
>>> filter_integers(['a', 3.14, 5])
[5]
>>> filter_integers([1, 2, 3, 'abc', {}, []])
[1, 2, 3]
"""
return [x for x in values if isinstance(x, int) and not isinstance(x, bool)]