Skip to content

Use is to compare types#406

Merged
astanin merged 1 commit into
astanin:masterfrom
DimitriPapadopoulos:is
Mar 5, 2026
Merged

Use is to compare types#406
astanin merged 1 commit into
astanin:masterfrom
DimitriPapadopoulos:is

Conversation

@DimitriPapadopoulos
Copy link
Copy Markdown
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Mar 5, 2026

This is consistent with other similar checks in the code base:

def _is_separating_line_value(value):
return type(value) is str and value.strip() == SEPARATING_LINE

I wonder whether isinstance() would be more appropriate. I mean, subclasses of list and str would also fit here.

This is consistent with other similar checks in the code base.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@1c7bbd8). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #406   +/-   ##
=========================================
  Coverage          ?   84.19%           
=========================================
  Files             ?        1           
  Lines             ?      892           
  Branches          ?      217           
=========================================
  Hits              ?      751           
  Misses            ?      107           
  Partials          ?       34           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@astanin
Copy link
Copy Markdown
Owner

astanin commented Mar 5, 2026

Good point about subclasses, but this is used with built-in TableFormats, so using is is fine for now.

It may break some custom user's formats, but it's unlikely.

@astanin astanin merged commit 3fcf88e into astanin:master Mar 5, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants