Skip to content

Commit

Permalink
Replace todo list with package description
Browse files Browse the repository at this point in the history
  • Loading branch information
bwhmather committed Apr 19, 2021
1 parent c26f77a commit 209f005
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions src/ssort/__init__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
"""
Steps:
- Identify chunks of file representing classes, declarations and functions.
- Parse each chunk to identify dependencies.
- Apply a stable topological sort.
Identifying chunks:
- Comments should be attached to whatever comes after them.
Weird things to handle:
- Unpacking resulting in multiple assignments.
- Semicolons resulting in multiple statements on same line.
- Comments attached to assignments.
- Redefinitions.
- Cycles.
- Immediate dependencies (e.g. decorators) vs deferred dependencies (e.g.
closed over variables)
- Deferred dependencies being re-evaluated part way through the file.
- Preventing re-ordering.
- Type annotations.
Handling the difference between immediate and deferred deps:
- Treat all dependencies the same.
- Try to resolve dependencies immediately.
- If that fails, resolve dependencies at the very end.
Extensions:
- Class members.
- Closures.
The python source code statement sorter.
"""
from ssort._ssort import ssort

Expand Down

0 comments on commit 209f005

Please sign in to comment.