[ase-users] super subroutine on old python versions

Janne Blomqvist Janne.Blomqvist at tkk.fi
Fri Aug 12 08:46:17 CEST 2011


On Thu, 2011-08-11 at 17:12 +0200, Astrid Nikodem wrote:
> diff -rN -u old-python-3.5.0/ase/constraints.py 
> new-python-3.5.0/ase/constraints.py
> --- old-python-3.5.0/ase/constraints.py 2011-08-11 16:11:54.000000000 +0200
> +++ new-python-3.5.0/ase/constraints.py 2011-08-11 16:11:54.000000000 +0200
> @@ -22,7 +22,7 @@
>           start = s.start
>       return enumerate(range(start, s.stop, step))
> 
> -class FixConstraint:
> +class FixConstraint(object):
>       """Base class for classes that fix one or more atoms in some way."""
> 
>       def index_shuffle(self, ind):
> 

I committed a change like this a year or two (?) ago, but it had to be
reverted because it broke backwards compatibility for the trajectory
file format (which is just a pickle of a python object graph).

FWIW, for classes which are not part of the trajectory, I don't think
there is any harm in deriving from object.


-- 
Janne Blomqvist




More information about the ase-users mailing list