Why does pyright-extended say my import is unsorted?

Question:
What am I supposed to do? What does it mean “un-sorted”? It’s literally two lines of code and I don’t know of a better way to do it.

Repl link/Link to where the bug appears:
https://replit.com/@CoderElijah/MutedLegalPolyhedron#main.py

Screenshots, links, or other helpful context:

image
image

Code Snippets:

from time import sleep
sleep(1)
import time
time.sleep(1)

After the import block (in your case, only the import time line), there should be one empty line (but I’m used to putting two).

You can configure it to be 2 empty lines after import block.

2 Likes

It’s useful to know how to configure pyright-extended so you can turn off certain warnings or add more rules. This specific warning is part of the isort ruleset in ruff.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.