Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bedroombuilds/python2rust
/ classify
Function
classify
06_pattern_matching/python/pattern_matching.py:14–19 ·
view source on GitHub ↗
(pet)
Source
from the content-addressed store, hash-verified
12
13
14
def
classify(pet):
15
match pet:
16
case Cat(age=age):
17
print(
"A cat that's {} years old"
.format(age))
18
case Dog:
19
print(
"A dog named {}"
.format(pet.name))
20
21
def
number(x):
22
match x:
Callers
1
pattern_matching.py
File · 0.70
Calls
1
print
Function · 0.50
Tested by
no test coverage detected