Changeset View
Changeset View
Standalone View
Standalone View
docs/content/concepts/types.mdx
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
@solid | @solid | ||||
def double_even(even_num: EvenType) -> EvenType: | def double_even(even_num: EvenType) -> EvenType: | ||||
return EvenType(even_num.num * 2) | return EvenType(even_num.num * 2) | ||||
``` | ``` | ||||
#### Mapping existing classes | #### Mapping existing classes | ||||
```python file=/concepts/types/make_usable.py | ```python file=/concepts/types/make_usable.py | ||||
from dagster import PythonObjectDagsterType, make_python_type_usable_as_dagster_type, solid | from dagster import ( | ||||
PythonObjectDagsterType, | |||||
make_python_type_usable_as_dagster_type, | |||||
solid, | |||||
) | |||||
class EvenType: | class EvenType: | ||||
def __init__(self, num): | def __init__(self, num): | ||||
assert num % 2 is 0 | assert num % 2 is 0 | ||||
self.num = num | self.num = num | ||||
Show All 17 Lines |