Re: Why Python When There Is Perl?

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Why Python When There Is Perl?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacy
Date : 11. Apr 2024, 08:47:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uv812m$1i06k$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Wed, 10 Apr 2024 08:36:35 -0400, Chris Ahlstrom wrote:

Lawrence D'Oliveiro wrote this copyrighted missive and expects
royalties:
 
I came up with an interesting use for [metaclasses], to allow
convenient definition of a hierarchy of exception classes representing
return codes from a given API. More details in the “Uses For
Metaclasses” notebook in this collection
<https://gitlab.com/ldo/python_topics_notebooks/>.
 
Interesting. It is not clear to me why you need metaclasses to implement
the example, though.

How would you do it at least as easily, without them?

And how would you do that in C++?

On another note, C++20 introduces the concept of "concepts", which put
constraints on templates and their parameters.

In Python, that would just be another instance of the same type-annotation
system it already has. Remember that Python does not need a “template
language” versus a “run-time language”.

These programming languages arms races are fun!

C++ is already over 5× the complexity of Python, and looks like it is
growing even faster.

In other words, it is C++ that is struggling to keep up, not Python.

Date Sujet#  Auteur
2 Oct 24 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal