flake8-mutable
--------------
[![PyPI version](https://img.shields.io/pypi/v/flake8-mutable.svg)](https://pypi.python.org/pypi/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:14: M511 - mutable default arg of type Dict
```
#### Installation
```
pip install flake8-mutable
```
#### Changes
##### [1.1.0] 2016-11-26
- Callables
##### [1.0.6] 2016-11-26
- added MANIFEST.in
#### License
[MIT](https://opensource.org/licenses/MIT)
Raw data
{
"_id": null,
"home_page": "https://github.com/ebeweber/flake8-mutable",
"name": "flake8-mutable",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "flake8 mutable arg kwarg",
"author": "Matthew Ebeweber",
"author_email": "mebeweber@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/97/6a/0fd1d903848fe043c7b6e5283d9def56425754098e69d7683a3ccbbea345/flake8-mutable-1.2.0.tar.gz",
"platform": "UNKNOWN",
"description": "flake8-mutable\n--------------\n\n[![PyPI version](https://img.shields.io/pypi/v/flake8-mutable.svg)](https://pypi.python.org/pypi/flake8-mutable)\n\n#### Motivation\n\nPython'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).\n\n#### Example\n\n```\ndef fnc(a, b={}):\n pass\n\nfoo.py:2:14: M511 - mutable default arg of type Dict\n```\n\n#### Installation\n\n```\npip install flake8-mutable\n```\n\n#### Changes\n\n##### [1.1.0] 2016-11-26\n- Callables\n\n##### [1.0.6] 2016-11-26\n- added MANIFEST.in\n\n#### License\n\n[MIT](https://opensource.org/licenses/MIT)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "mutable defaults flake8 extension",
"version": "1.2.0",
"split_keywords": [
"flake8",
"mutable",
"arg",
"kwarg"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "63086e2cc1825ce4a78780b71f99b2ff",
"sha256": "38fd9dadcbcda6550a916197bc40ed76908119dabb37fbcca30873666c31d2d5"
},
"downloads": -1,
"filename": "flake8_mutable-1.2.0-py2-none-any.whl",
"has_sig": false,
"md5_digest": "63086e2cc1825ce4a78780b71f99b2ff",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 3429,
"upload_time": "2017-04-24T02:53:00",
"upload_time_iso_8601": "2017-04-24T02:53:00.860129Z",
"url": "https://files.pythonhosted.org/packages/b8/e8/b0c83d223dc5aa5106f9bb7046f0449fd4c8c30271adbdacf2bd9d647a60/flake8_mutable-1.2.0-py2-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "5976fbe6c578d8c43ba1a8c372bdc3a5",
"sha256": "ee9b77111b867d845177bbc289d87d541445ffcc6029a0c5c65865b42b18c6a6"
},
"downloads": -1,
"filename": "flake8-mutable-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5976fbe6c578d8c43ba1a8c372bdc3a5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2984,
"upload_time": "2017-04-24T02:52:58",
"upload_time_iso_8601": "2017-04-24T02:52:58.487844Z",
"url": "https://files.pythonhosted.org/packages/97/6a/0fd1d903848fe043c7b6e5283d9def56425754098e69d7683a3ccbbea345/flake8-mutable-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2017-04-24 02:52:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "ebeweber",
"github_project": "flake8-mutable",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "flake8",
"specs": [
[
"==",
"2.5.4"
]
]
},
{
"name": "mccabe",
"specs": [
[
"==",
"0.4.0"
]
]
},
{
"name": "pep8",
"specs": [
[
"==",
"1.7.0"
]
]
},
{
"name": "pyflakes",
"specs": [
[
"==",
"1.0.0"
]
]
}
],
"lcname": "flake8-mutable"
}