You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bebop/bebop/links.py

14 lines
370 B

"""Links manager."""
class Links(dict):
def disambiguate(self, digits: str, max_digits: int):
"""Return the list of possible candidates for those digits."""
if len(digits) == max_digits:
return [int(digits)]
return [
link_id for link_id, url in self.items()
if str(link_id).startswith(digits)
]