[ase-users] super subroutine on old python versions

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Fri Aug 19 09:07:46 CEST 2011


fre, 12 08 2011 kl. 08:46 +0200, skrev Janne Blomqvist:
> 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.

Why is it that we are using super()?  Is it really necessary?

Jens Jørgen






More information about the ase-users mailing list