Liste des Groupes | Revenir à co vms |
On 8/28/24 8:49 PM, Lawrence D'Oliveiro wrote:open is still listed at:On Wed, 28 Aug 2024 16:35 +0100 (BST), John Dallman wrote:The extra things you import if you don't have a builtin that does whatIn article <valhi8$34s18$4@dont-email.me>, ldo@nz.invalid (Lawrence>
D'Oliveiro) wrote:Perl actually has a vast range of builtins.>
True, but they are at least all in one list. The problem I've had with
Python is finding what the word is to do a thing.
I’m not sure I understand that. Python does things by “constructs” rather
than individual “words”. Do you mean function and class names?
you want are called modules in both Perl and Python. As far as I can
tell he's just saying that with Perl, the operations he uses most (e.g.
I/O and regular expressions) are already there as builtins and there are
no "use" statements necessary to import modules to do those things.
There are 150+ modules that ship with Perl and thousands more on CPAN,
and you do need some of them to do some things. But John is right; Perl
is quite a capable language, sort of an awk on steroids, without those
things.
Python also ships with a ton of modules and has many more available via
pip. But it has moved in the direction of fewer builtins and needing
modules to do pretty much anything. I think Python 2 had an "open"
builtin but in Python 3 you have to "import io" and use "io.open." I'm
sure I will get a lecture on all the computer sciency reasons that's a
superior way of doing things. But for someone trying to get work done,
having the tools you use most already out on the workbench without
having to remember which tool chest they're in can be an advantage.
Les messages affichés proviennent d'usenet.