Sujet : Re: Common objects for CLI commands with Typer
De : barry (at) *nospam* barrys-emacs.org (Barry Scott)
Groupes : comp.lang.pythonDate : 23. Sep 2024, 19:00:10
Autres entêtes
Message-ID : <mailman.5.1727114437.2990.python-list@python.org>
References : 1 2 3 4
User-Agent : Apple Mail (2.3818.100.11.1.3)
On 21 Sep 2024, at 11:40, Dan Sommers via Python-list <python-list@python.org> wrote:
Despite the fact that "everything is an object" in Python, you don't
have to put data or functions inside classes or objects. I also know
nothing about Typer, but there's nothing wrong with functions in a
module.
Python is great in allowing you to pick your style.
A few lines in a module, a couple of functions or use classes.
But once your code gets big the disciple of using classes helps
maintenance. Code with lots of globals is problematic.
Barry