Sujet : Re: Why Python When There Is Perl?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacyDate : 21. Mar 2024, 08:04:13
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <utgikt$21nsq$1@dont-email.me>
References : 1 2 3 4
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On 21 Mar 2024 05:36:18 GMT, rbowman wrote:
I'm looking at some C code using the OpenSSL
library to connect to a host/port, do a HTTPS transaction. and return
the result. There's a generous amout of error checking and handling and
it's 84 lines rather than 1.
You can do it in Python, leave most of the error checking to the default
settings, and end up with maybe a dozen lines of code.
The sniipets aren't long but he goes into list comprehension,
decorators, some of the more obscure dunders, setting up classes with
class variables,
instance variables, and static functions using decorators, why you might
want to do so, and how they work.
Does he mention descriptors? They are rather key to understanding how
instance/class/static method dispatching works (and properties).
Does he talk about metaclasses? There is one use of them in the standard
library (that I’m aware of), and I recently came up with another one.