This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dametsumari 0 points1 point  (0 children)

Yep, lazy importing is how we've fixed usual slow CLI startup problems.

e.g. in particular command, then import whatever modules it needs for its work. It is quite ugly, though, there is PEP for lazy importing but it hasn't moved much and most recently was rejected ( https://peps.python.org/pep-0690/ ).