B008 Do not perform function calls in argument defaults

Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.

Extra parameters

These are defined by flake8-bugbear in the code and define the behavior of the violation. That's why we decided to print them here, for your reference.
Parameter Value
  • MappingProxyType
  • frozenset
  • tuple
  • types.MappingProxyType