MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / find_anagrams

Function find_anagrams

example_code/item_118_example_07.py:24–37  ·  view source on GitHub ↗

Find all anagrams for a word. This function only runs as fast as the test for membership in the 'dictionary' container. Args: word: Target word. dictionary: All known actual words. Returns: Anagrams that were found.

(word: str, dictionary: Container[str])

Source from the content-addressed store, hash-verified

22from collections.abc import Container
23
24def find_anagrams(word: str, dictionary: Container[str]) -> list[str]:
25 """Find all anagrams for a word.
26
27 This function only runs as fast as the test for
28 membership in the 'dictionary' container.
29
30 Args:
31 word: Target word.
32 dictionary: All known actual words.
33
34 Returns:
35 Anagrams that were found.
36 """
37 return []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected