Deep vs. shallow copy?
steve+comp.lang.python at pearwood.info
Thu Mar 13 00:07:53 CET 2014
On Wed, 12 Mar 2014 15:29:59 +0000, Alex van der Spek wrote:
> Having been taught programming in Algol60 Python still defeats me at
> times! Particularly since Algol60 wasn't very long lived and what came
> thereafter (FORTRAN) much worse.
Fortran came first. Fortran was the first high-level language which
allowed the programmer to write things that looked rather like the sorts
of mathematical expressions they were used to.
There were a few higher-level assembly languages that came before
Fortran, such as SpeedCoding, Fortran's predecessor, but Fortran was the
first truly high-level programming language, and even in 1957 it came
with an optimizing compiler.
I'm not really familiar with Algol, but I do know Pascal, and you should
think of the append method to be like a Pascal procedure. Because Python
doesn't have true procedures, it follows the convention that returning
the special object None signals the intention to return nothing at all.
Hence your example below:
>>>> c = a.append(b)
>>>> print c
More information about the Python-list