Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <mailman.5.1727114437.2990.python-list@python.org>
Deutsch   English   Français   Italiano  
<mailman.5.1727114437.2990.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: Barry Scott <barry@barrys-emacs.org>
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: <mailman.5.1727114437.2990.python-list@python.org>
References: <87tteayavt.fsf@zedat.fu-berlin.de>
 <28833A4D-B57C-4195-87BF-FAAF9EFF5F19@barrys-emacs.org>
 <Zu6ipTbew8LSHvKG@anomaly>
 <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: <barry@barrys-emacs.org>
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:<span': 0.16; 'wrote:': 0.16;
 'python': 0.16; 'cc:addr:python.org': 0.20; 'code': 0.23; 'lines':
 0.23; 'python,': 0.25; 'cc:2**0': 0.25; 'classes': 0.26; 'fact':
 0.28; 'email addr:python.org>': 0.28; 'wrong': 0.28; 'python-
 list': 0.32; 'sep': 0.32; 'but': 0.32; 'subject:for': 0.33; '0);':
 0.33; 'rgb(0,': 0.33; 'header:In-Reply-To:1': 0.34; 'functions':
 0.36; 'couple': 0.37; 'using': 0.37; 'put': 0.38; 'use': 0.39;
 'helps': 0.60; 'font-family:': 0.60; 'inline': 0.61; 'skip:h 10':
 0.61; "there's": 0.61; 'display:': 0.62; 'none;': 0.62; 'font-
 weight:': 0.62; 'great': 0.63; '0px;': 0.63; 'once': 0.63; 'your':
 0.64; 'text-indent:': 0.64; 'normal;': 0.66; 'received:217': 0.67;
 'skip:! 10': 0.67; 'float:': 0.74; 'skip:! 20': 0.81; 'email
 name:<python-list': 0.84; '400;': 0.89; '13px;': 0.91;
 'none;">': 0.91
In-Reply-To: <Zu6ipTbew8LSHvKG@anomaly>
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
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=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>
 <Zu6ipTbew8LSHvKG@anomaly>
Bytes: 4053



> On 21 Sep 2024, at 11:40, Dan Sommers via Python-list =
<python-list@python.org> 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