|
|
Subscribe / Log in / New account

An interview with Larry Wall (LinuxVoice)

An interview with Larry Wall (LinuxVoice)

Posted Jul 26, 2015 20:06 UTC (Sun) by dvdeug (guest, #10998)
In reply to: An interview with Larry Wall (LinuxVoice) by Cyberax
Parent article: An interview with Larry Wall (LinuxVoice)

In Python, "a + b" could return literally any type, any value. All it takes is the appropriate "def __add__ (a, b): return value" in some class somewhere. That being "brain damaged" is an opinion I'm not going to get into, but it's not different between Perl and Python.


to post comments

An interview with Larry Wall (LinuxVoice)

Posted Jul 26, 2015 23:02 UTC (Sun) by anselm (subscriber, #2796) [Link]

In Python, "a + b" could return literally any type, any value. All it takes is the appropriate "def __add__ (a, b): return value" in some class somewhere.

That applies to Perl, too – see “perldoc overload”.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds