Files
clover/docs/en/migrate22.md
2020-10-20 11:19:23 +03:00

942 B

Migration to version 0.20

Python 3 transition

Python 2 is deprecated since January 1st, 2020. The Clover platform moves to Python 3.

For running flight script instead of python command:

python flight.py

use python3 command:

python3 flight.py

Python 3 has certain syntax differences in comparison with the old version. Instead of print operator:

print 'Clover is the best'

use print function:

print('Clover is the best')

The division operator operates floating points by default (instead of integer). Python 2:

>>> 10 / 4
2

Python 3:

>>> 10 / 4
2.5

For strings unicode type is used by default (instead of str type).

Encoding specification (# coding: utf8) is not necessary any more.

More details on all the language changes see in appropriate article.