Skip to main content

flake8-get-chaining

A flake8 plugin finding likely bugs when chaining dict.get calls

CI Code style PyPI - Python Version PyPI - Version

flake8-get-chaining plugin checks for chained dict.get calls and makes sure valid defaults are provided.

Installation


Install from pip with:

$ pip install flake8-get-chaining

It will then automatically be run as part of flake8; you can check it has been picked up with:

$ flake8 --version
5.0.4 (flake8-get-chaining: 0.1.0, mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.9 on Linux

List of warnings


DGC1001: Missing default argument when chaining dict.get
This warning is emitted when dict.get calls are chained, and no default was provided.

Example: my_dict.get("foo").get("bar")

DGC1002: Invalid default argument when chaining dict.get
This warning is emitted when dict.get calls are chained, and the default value is
invalid (i.e not a dict nor an identifier)

Example: my_dict.get("foo", "bar").get("baz")

Metadata

Release files for flake8-get-chaining 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-get-chaining 0.2.0
File Size Uploaded
flake8_get_chaining-0.2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-get-chaining 0.2.0
File Interpreter ABI Platform
flake8_get_chaining-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / flake8_get_chaining-0.2.0.tar.gz

Download URL flake8_get_chaining-0.2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5dd896f0c77997fed4f14b1a25360c965e712a7bbe9ebaaccad1dbd5932eeaab
BLAKE2b-256 checksum
How to use checksums
fb6501aeb7949e6f312e421383630e0cc3065292d88e06fd43675a50f5b50c0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / flake8_get_chaining-0.2.0-py3-none-any.whl

Download URL flake8_get_chaining-0.2.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d9a04d67a6437474cece7d126bee80175c259e6026e010a0821d424616ab59c
BLAKE2b-256 checksum
How to use checksums
eb5f83884170e88b50aa9a389ab30bea565961c03ea4b591697431aec2437819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page