Type hinting the Color class should work:
def get_color_return_something(some_color: Color):
print(some_color.value)
More Related Contents:
- How do I type hint a method with the type of the enclosing class?
- What are variable annotations?
- How to specify multiple return types using type-hints
- How can I specify the function type in my type hints?
- Type hinting a collection of a specified type
- What are type hints in Python 3.5?
- Using the class as a type hint for arguments in its methods [duplicate]
- Type hint for a function that returns only a specific set of values
- How to use type hints in python 3.6?
- How to specify “nullable” return type with type hints
- How should I use the Optional type hint?
- Type hints when unpacking a tuple?
- Exclude type in Python typing annotation
- Python type hinting with exceptions
- Type hinting / annotation (PEP 484) for numpy.ndarray
- Can I omit Optional if I set default to None?
- Name not defined in type annotation [duplicate]
- Python 3.5 type hinting does not result in an error
- How to annotate function that takes a tuple of variable length? (variadic tuple type annotation)
- Recursive Typing in Python 3.5+ [duplicate]
- What is the type hint for a (any) python module?
- How can I represent an ‘Enum’ in Python?
- Type hints: solve circular dependency [duplicate]
- Python type hinting without cyclic imports
- A way to subclass NamedTuple for purposes of typechecking
- How to annotate types of multiple return values?
- typing.Any vs object?
- Python type hint for classes that support __getitem__
- Weird MRO result when inheriting directly from typing.NamedTuple
- How to annotate a type that’s a class object (instead of a class instance)?