Python to Scala Collections

SkillDev tools

Guide for mapping Python collection types and operations to Scala equivalents.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Python to Scala Collections skill

What this skill tells your AI

The instructions your AI receives, as published by cxcscmu/skilllearnbench in skills/b1-one-shot-claude-opus-4-6/python-scala-translation/python-scala-collections/SKILL.md and read by ahel’s review.

Type Mappings

PythonScala
list[T]List[T] or mutable.ListBuffer[T]
dict[K, V]Map[K, V] or mutable.Map[K, V]
tuple[T, ...](T, ...) or Vector[T]
set[T]Set[T]
Sequence[T]Seq[T]
Iterable[T]Iterable[T]
Iterator[T]Iterator[T]

Mutable Collections

import scala.collection.mutable

// Python: list with append -> mutable.ListBuffer
val buf = mutable.ListBuffer.empty[Token]
buf += token

// Python: dict -> mutable.Map
val reg = mutable.Map.empty[String, TokenContainer[T]]
reg(key) = container

Collection Operations

// Python: [f(x) for x in xs] -> xs.map(f)
// Python: [x for x in xs if p(x)] -> xs.filter(p)
// Python: enumerate(xs) -> xs.zipWithIndex

Signals

GitHub stars
83
Forks
5
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
python-scala-collections
Source
github.com/cxcscmu/skilllearnbench