Skip to main content

mutable defaults flake8 extension

Project description

flake8-mutable
--------------

#### Motivation

Python's default arguments are evaluated at definition as opposed to when the function is invoked. This leads to unexpected behavior, as mutations persist between calls. For a more detailed explanation, see [The Hitchhiker's Guide to Python](http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments).

#### Example

```
def fnc(a, b={}):
pass

foo.py:2:1: M511 - mutable default arg of type Dict
```

#### Installation

```
pip install flake8-mutable
```


#### License

[MIT](https://opensource.org/licenses/MIT)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-mutable-1.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_mutable-1.1.0-py2-none-any.whl (3.1 kB view details)

Uploaded Python 2

File details

Details for the file flake8-mutable-1.1.0.tar.gz.

File metadata

File hashes

Hashes for flake8-mutable-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dc3824c5ef0b9bffdaa18ab64cd08ef8dcae30969033a6d71dfbac878a058c4f
MD5 8f35a558d80d6899347cb6f188559956
BLAKE2b-256 866080c6260326bf4273a41f76100734d94427f6aba82c28e879771a6962205d

See more details on using hashes here.

File details

Details for the file flake8_mutable-1.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for flake8_mutable-1.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 efe040cd13fde5b8a940deda4c278cdb183cfe34cd32505a90aa506cd9715eed
MD5 59ba4ccc52b57a73dd1d2ebefd340e62
BLAKE2b-256 ab9eab8c60a99b14d3c30b013144993fcf69c97adfae99fb92fa7f8caace683a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page