python-scala-syntax-mapping
Reference guide for translating Python syntax constructs to Scala equivalents
Install / Use
npx skills add benchflow-ai/skillsbench --skill python-scala-syntax-mappingInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of python-scala-syntax-mapping
python-scala-syntax-mapping scores 86/100 on our quality scale, 1606th of 4,140 Development & Engineering skills we index (top 39%).
Its SKILL.md is 4.0 KB long, well organised into 23 sections with 14 code examples: a solid amount of guidance for an agent.
With 1,813 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so python-scala-syntax-mapping is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
python-scala-syntax-mapping compared with similar skills
All 4 of these similar skills score higher than python-scala-syntax-mapping; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| python-scala-syntax-mapping (this skill)by benchflow-ai | 86 | 1.8k | 2mo ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 86.4k | 15d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.2k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 44.6k | 1d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | today | CLAUDE.md |
Frequently asked questions
- How do I install python-scala-syntax-mapping?
- Run
npx skills add benchflow-ai/skillsbench --skill python-scala-syntax-mapping. The install tabs above show the steps for each supported agent. - Which AI agents does python-scala-syntax-mapping work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is python-scala-syntax-mapping safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is python-scala-syntax-mapping still maintained?
- The repository was last updated about 2 months ago, so python-scala-syntax-mapping is actively maintained.
Skill content
View source on GitHubname: python-scala-syntax-mapping description: Reference guide for translating Python syntax constructs to Scala equivalents. Use when converting Python code to Scala and need mappings for basic syntax elements like variable declarations, control flow, comprehensions, string formatting, and common operators.
Python to Scala Syntax Mapping
Variable Declarations
| Python | Scala |
|--------|-------|
| x = 5 | val x = 5 (immutable) or var x = 5 (mutable) |
| x: int = 5 | val x: Int = 5 |
| x, y = 1, 2 | val (x, y) = (1, 2) |
Prefer val over var unless mutation is required.
Type Mappings
| Python | Scala |
|--------|-------|
| int | Int |
| float | Double |
| str | String |
| bool | Boolean |
| None | None (of type Option) or null |
| list[T] | List[T] or Seq[T] |
| dict[K, V] | Map[K, V] |
| set[T] | Set[T] |
| tuple[A, B] | (A, B) or Tuple2[A, B] |
| Optional[T] | Option[T] |
Control Flow
Conditionals
# Python
if x > 0:
result = "positive"
elif x < 0:
result = "negative"
else:
result = "zero"
// Scala - if is an expression
val result = if (x > 0) "positive"
else if (x < 0) "negative"
else "zero"
Loops
# Python for loop
for i in range(10):
print(i)
for item in items:
process(item)
for i, item in enumerate(items):
print(f"{i}: {item}")
// Scala equivalents
for (i <- 0 until 10) println(i)
for (item <- items) process(item)
for ((item, i) <- items.zipWithIndex) println(s"$i: $item")
While loops
# Python
while condition:
do_something()
// Scala
while (condition) {
doSomething()
}
Comprehensions
# Python list comprehension
squares = [x ** 2 for x in range(10)]
evens = [x for x in numbers if x % 2 == 0]
pairs = [(x, y) for x in xs for y in ys]
// Scala for-comprehensions or map/filter
val squares = (0 until 10).map(x => x * x).toList
val evens = numbers.filter(_ % 2 == 0)
val pairs = for { x <- xs; y <- ys } yield (x, y)
Functions
# Python
def add(a: int, b: int) -> int:
return a + b
# Lambda
square = lambda x: x ** 2
# Default arguments
def greet(name: str, greeting: str = "Hello") -> str:
return f"{greeting}, {name}!"
// Scala
def add(a: Int, b: Int): Int = a + b
// Lambda
val square: Int => Int = x => x * x
// or shorter: val square = (x: Int) => x * x
// Default arguments
def greet(name: String, greeting: String = "Hello"): String =
s"$greeting, $name!"
String Formatting
| Python | Scala |
|--------|-------|
| f"Hello, {name}!" | s"Hello, $name!" |
| f"Value: {x:.2f}" | f"Value: $x%.2f" |
| f"{x + y}" | s"${x + y}" |
Common Operators
| Python | Scala |
|--------|-------|
| ** (power) | math.pow(x, y) or use scala.math.pow |
| // (floor div) | x / y (for Int) or math.floor(x / y) |
| % (modulo) | % |
| and, or, not | &&, ||, ! |
| in | .contains() |
| is | eq (reference equality) |
| == | == (value equality) |
Exception Handling
# Python
try:
result = risky_operation()
except ValueError as e:
handle_error(e)
finally:
cleanup()
// Scala
import scala.util.{Try, Success, Failure}
// Pattern 1: try-catch
try {
val result = riskyOperation()
} catch {
case e: IllegalArgumentException => handleError(e)
} finally {
cleanup()
}
// Pattern 2: Try monad (preferred for functional style)
val result = Try(riskyOperation()) match {
case Success(value) => value
case Failure(e) => handleError(e)
}
None/Null Handling
# Python
if value is None:
return default
return process(value)
# Or
result = value if value is not None else default
// Scala - use Option
val result = optionValue match {
case Some(v) => process(v)
case None => default
}
// Or more concisely
val result = optionValue.map(process).getOrElse(default)
Related Skills
Agent-Reach
86.4kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
44.6kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
