Skip to content

Remove redundant None provided as default to dict.get() #11448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

kaxil
Copy link
Member

@kaxil kaxil commented Oct 11, 2020

It is unnecessary to provide None as the default value when the key is not present in the dictionary as get implicitly returns None.

value = example_dict.get("key", None)

and

value = example_dict.get("key")

are same.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@kaxil kaxil requested review from turbaszek and XD-DENG October 11, 2020 22:32
@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:Scheduler including HA (high availability) scheduler area:webserver Webserver related Issues provider:Apache provider:amazon AWS/Amazon - related issues provider:google Google (including GCP) related issues labels Oct 11, 2020
@kaxil kaxil force-pushed the remove-redun-none branch from d4e5bfe to 42fff0e Compare October 11, 2020 23:01
@kaxil kaxil merged commit d305876 into apache:master Oct 11, 2020
@kaxil kaxil deleted the remove-redun-none branch October 11, 2020 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:Scheduler including HA (high availability) scheduler area:webserver Webserver related Issues provider:amazon AWS/Amazon - related issues provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants