---
name: filter_list
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def filter_list(xs: list, pred: callable) -> list"
description: "Filtra una lista aplicando un predicado sin mutar la original."
tags: [list, functional, filter, python, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
params:
  - name: xs
    desc: "lista a filtrar"
  - name: pred
    desc: "predicado (funcion que retorna bool) para seleccionar elementos"
output: "lista con solo los elementos que cumplen el predicado"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/core/core.py"
---

## Ejemplo

```python
evens = filter_list([1, 2, 3, 4], lambda n: n % 2 == 0)
# [2, 4]
```

## Notas

Funcion pura. No muta la lista original. Equivalente a `[x for x in xs if pred(x)]`.
