Python on Solaris: Wrong ELF class: ELFCLASS64

If “pip” installed 64-bit libraries, while python is a 32-bit binary, “pkg” might stop working with the following error messages:

ImportError: ld.so.1: bootadm: fatal: /usr/lib/python2.7/site-packages/lxml/etree.so: wrong ELF class: ELFCLASS64
ImportError: ld.so.1: python2.7: fatal: /usr/lib/python2.7/site-packages/_cffi_backend.so: wrong ELF class: ELFCLASS64
$ file `which python`
/usr/bin/python:	ELF 32-bit LSB executable 80386 Version 1 [SSE], dynamically linked, not stripped

The workaround is to remove the corresponding python packages (in this case cffi and lxml), download and recompile them manually with “-m32”:

$ export CFLAGS="-m32"

Empty set vs empty string vs nothing and Zen

From my explanations of the set theory to my daughter yesterday.

A set is a container, an empty string (ε or nothing) is an element. A set with nothing inside is not empty, because there is nothing inside. A set is empty (∅) if it does not have anything inside.

In python:

$ python
>>> nothing=''
>>> set=[nothing]
>>> set
['']
>>> set.append('')
>>> set
['', '']
>>> set.remove('')
>>> set
['']
>>> set.remove(nothing)
>>> set
[]
>>> emptyset=[]
>>> emptyset
[]

Doing nothing and not doing anything are two different things.