PEP 484 provides an official solution to this in the form of forward references.
When a type hint contains names that have not been defined yet, that definition may be expressed as a string literal, to be resolved later.
In the case of the question code:
class Trie:
@staticmethod
def from_mapping(mapping) -> Trie:
# docstrings and initialization ommitted
trie = Trie()
return trie
Becomes:
class Trie:
@staticmethod
def from_mapping(mapping) -> 'Trie':
# docstrings and initialization ommitted
trie = Trie()
return trie