athphane / userbot

Consider iterating dictionary PYL-C0201
Anti-pattern
Major
6 months ago2 years old
Consider iterating the dictionary directly instead of calling .keys()
320
321    final_str = ""
322    for char in text:
323        if char in MEMES.REPLACEMENT_MAP.keys():324            new_char = MEMES.REPLACEMENT_MAP[char]
325        else:
326            new_char = char
Consider iterating the dictionary directly instead of calling .keys()
63    # Key will be group name
64    # values will be dict of dicts of key command and value description
65
66    if module_name in CMD_HELP.keys():67        command_dict = CMD_HELP[module_name]
68    else:
69        command_dict = {}