---
name: chunk
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def chunk(xs: list, size: int) -> list"
description: "Divide una lista en sublistas de tamanio fijo. El ultimo chunk puede ser menor."
tags: [list, functional, chunk, partition, python, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
params:
  - name: xs
    desc: "lista a dividir"
  - name: size
    desc: "tamanio de cada sublista (chunk)"
output: "lista de sublistas, cada una con maximo 'size' elementos"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/core/core.py"
---

## Ejemplo

```python
result = chunk([1, 2, 3, 4, 5], 2)
# [[1, 2], [3, 4], [5]]
```

## Notas

Funcion pura. Si size <= 0 retorna lista vacia.
