Skip to content

Remove unnecessary import that confuses type checkers#3624

Merged
willmcgugan merged 1 commit intoTextualize:masterfrom
itamaro:patch-1
Mar 30, 2025
Merged

Remove unnecessary import that confuses type checkers#3624
willmcgugan merged 1 commit intoTextualize:masterfrom
itamaro:patch-1

Conversation

@itamaro
Copy link
Copy Markdown
Contributor

@itamaro itamaro commented Jan 29, 2025

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

in rich.table, when executed as a main script, it imports Table from itself.

this seems unnecessary, considering the Table class is implemented in the same module.
this isn't only cosmetic though - at least one type checker (Pyre) gets confused because of this, and treats Table as a symbol that isn't exported by rich.table.

please let me know if this change is acceptable, and if so, whether it needs a CHANGELOG entry and/or additional tests.

@willmcgugan
Copy link
Copy Markdown
Member

I think pyre is in the wrong here, but ok.

@willmcgugan willmcgugan merged commit e667349 into Textualize:master Mar 30, 2025
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