> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Common mistakes

<AccordionGroup>
  <Accordion title="default-mutable-dict">
    Function $F mutates default dict $D. Python only instantiates default function arguments once and shares the instance across the function calls. If the default function argument is mutated, that will modify the instance used by all future function calls. This can cause unexpected results, or lead to security vulnerabilities whereby one function consumer can view or modify the data of another function consumer. Instead, use a default argument (like None) to indicate that no argument was provided and instantiate a new dictionary at that time. For example: `if $D is None: $D = {}`.
  </Accordion>

  <Accordion title="is-not-is-not">
    In Python 'X is not ...' is different from 'X is (not ...)'. In the latter the 'not' converts the '...' directly to boolean.
  </Accordion>

  <Accordion title="string-concat-in-list">
    Detected strings that are implicitly concatenated inside a list. Python will implicitly concatenate strings when not explicitly delimited. Was this supposed to be individual elements of the list?
  </Accordion>

  <Accordion title="default-mutable-list">
    Function $F mutates default list $D. Python only instantiates default function arguments once and shares the instance across the function calls. If the default function argument is mutated, that will modify the instance used by all future function calls. This can cause unexpected results, or lead to security vulnerabilities whereby one function consumer can view or modify the data of another function consumer. Instead, use a default argument (like None) to indicate that no argument was provided and instantiate a new list at that time. For example: `if $D is None: $D = []`.
  </Accordion>

  <Accordion title="identical-is-comparison">
    Found identical comparison using is. Ensure this is what you intended.
  </Accordion>

  <Accordion title="string-is-comparison">
    Found string comparison using 'is' operator. The 'is' operator is for reference equality, not value equality, and therefore should not be used to compare strings. For more information, see [https://github.com/satwikkansal/wtfpython#-how-not-to-use-is-operator](https://github.com/satwikkansal/wtfpython#-how-not-to-use-is-operator)"
  </Accordion>
</AccordionGroup>
