Explanation of list reference

Marko Rauhamaa marko at pacujo.net
Sat Feb 15 14:44:39 CET 2014


Mark Lawrence <breamoreboy at yahoo.co.uk>:

> I have no interest in understanding object identity, I can write code
> quite happily without it.

Luckily, what we are now debating is mostly terminology and points of
view where the outcomes are unaffected.

However, as an example, it is important to know if you should write:

   if x is not None:
       ...

or if

   if x != None:
       ...

is more robust.

As an aside, thousands upon thousands of Java programmers churn out code
quite happily with no interest in understanding the "happens before"
relation (<URL:
http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4.5>),
which is heavily leaned on by Hotspot's JIT optimizer. I find that
disconcerting.


Marko



More information about the Python-list mailing list