> ## 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.

# Best practice

> [accordion] manual-defaultdict-dict-create
>
> manually creating a defaultdict - use collections.defaultdict(dict)

> [accordion] manual-defaultdict-set-create
>
> manually creating a defaultdict - use collections.defaultdict(set)

> [accordion] manual-defaultdict-list-create
>
> manually creating a defaultdict - use collections.defaultdict(list)

> [accordion] manual-counter-create
>
> manually creating a counter - use collections.Counter

> [accordion] hardcoded-tmp-path
>
> Detected hardcoded temp directory. Consider using 'tempfile.TemporaryFile' instead.

> [accordion] missing-hash-with-eq
>
> Class `$A` has defined `__eq__` which means it should also have defined `__hash__`;

> [accordion] pass-body-fn
>
> `pass` is the body of function \$X. Consider removing this or raise NotImplementedError() if this is a TODO

> [accordion] pass-body-range
>
> `pass` is the body of for $X in $Y. Consider removing this or raise NotImplementedError() if this is a TODO

> [accordion] arbitrary-sleep
>
> time.sleep() call; did you mean to leave this in?

> [accordion] unspecified-open-encoding
>
> Missing 'encoding' parameter. 'open()' uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding="utf-8").

> [accordion] open-never-closed
>
> file object opened without corresponding close

> [accordion] python-debugger-found
>
> Importing the python debugger; did you mean to leave this in?

> [accordion] logging-error-without-handling
>
> Errors should only be logged when handled. The code logs the error and propogates the exception, consider reducing the level to warning or info.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.