DEAP / deap

Distributed Evolutionary Algorithms in Python
http://deap.readthedocs.org/
GNU Lesser General Public License v3.0
5.75k stars 1.12k forks source link

Syntax error in base.py under Python 3 #638

Open timrprobocom opened 2 years ago

timrprobocom commented 2 years ago

Line 193 in base.py has

           raise TypeError, ("Both weights and assigned values must be a "
                              "sequence of numbers when assigning to values of "
                              "%r. Currently assigning value(s) %r of %r to a "
                              "fitness with weights %s."
                              % (self.__class__, values, type(values),
                                 self.weights)), traceback

That's the Python 2 syntax. For Python 3, that first comma needs to be removed.

https://github.com/DEAP/deap/blob/b8513fc16fa05b2fe6b740488114a7f0c5a1dd06/deap/base.py#L193

aabmets commented 2 years ago

@timrprobocom I've created a Python 3.10 port of the DEAP library called DEAP-er. It's currently in beta, but you could check it out and provide feedback about any bugs.