Skip to content
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

Simplify empty dictionary/None check #286

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

himalayanZephyr
Copy link

Simplifying empty dictionary/None check

Simplifying empty dictionary/None check
@hugovk hugovk changed the title Update prettytable.py Simplify empty dictionary/None check Feb 27, 2024
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.38%. Comparing base (6498a57) to head (54e690f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #286   +/-   ##
=======================================
  Coverage   94.38%   94.38%           
=======================================
  Files           5        5           
  Lines        2404     2404           
=======================================
  Hits         2269     2269           
  Misses        135      135           
Flag Coverage Δ
macos-latest 94.34% <100.00%> (ø)
ubuntu-latest 94.34% <100.00%> (ø)
windows-latest 94.30% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hugovk hugovk added the changelog: Changed For changes in existing functionality label Feb 28, 2024
@hugovk
Copy link
Member

hugovk commented Feb 28, 2024

And change the other six occurrences?

We can then also flip from:

if not val:
    ... # do when no val
else:
    ... # do when val

To:

if val:
    ... # do when val
else:
    ... # do when no val

@hugovk
Copy link
Member

hugovk commented Feb 28, 2024

And can these be called when val is something that is not None or dict, but still evaluates to false here? And if so, does it behave correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Changed For changes in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants