Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail From: Barry Scott Newsgroups: comp.lang.python Subject: Re: Common objects for CLI commands with Typer Date: Mon, 23 Sep 2024 19:00:10 +0100 Lines: 18 Message-ID: References: <87tteayavt.fsf@zedat.fu-berlin.de> <28833A4D-B57C-4195-87BF-FAAF9EFF5F19@barrys-emacs.org> <1E3ED29E-161E-430C-9E99-F89266472ADB@barrys-emacs.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3818.100.11.1.3\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de 5hgj9msCV42dSVkVXnTbNwtFpzqQIO3owl6wV+6uMUgw== Cancel-Lock: sha1:X6n6k33+DMySPB4D83WHy0cABUM= sha256:upvZ38C45hBS5B9br1MSQhBStbal2Ek4aSJE0M/3YwU= Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Status: OK 0.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'despite': 0.05; 'cc:addr :python-list': 0.09; 'dan': 0.09; 'from:addr:barry': 0.09; 'module.': 0.09; 'received:217.70': 0.09; 'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09; 'cc:no real name:2**0': 0.14; 'barry': 0.16; 'from:addr:barrys-emacs.org': 0.16; 'from:name:barry scott': 0.16; 'message-id:@barrys-emacs.org': 0.16; 'objects.': 0.16; 'wrote:': 0.91 In-Reply-To: X-Mailer: Apple Mail (2.3818.100.11.1.3) X-GND-Sasl: barry@barrys-emacs.org X-Content-Filtered-By: Mailman/MimeDel 2.1.39 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <1E3ED29E-161E-430C-9E99-F89266472ADB@barrys-emacs.org> X-Mailman-Original-References: <87tteayavt.fsf@zedat.fu-berlin.de> <28833A4D-B57C-4195-87BF-FAAF9EFF5F19@barrys-emacs.org> > On 21 Sep 2024, at 11:40, Dan Sommers via Python-list = wrote: >=20 > 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