Why isn’t my variable set when I call the other function? [duplicate]

This problem also comes up when migrating to Python 3.

In Python 2 comparing an integer to None will “work,” such that None is considered less than any integer, even negative ones:

>>> None > 1
False
>>> None < 1
True

In Python 3 such comparisons raise a TypeError:

>>> None > 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '>' not supported between instances of 'NoneType' and 'int'

>>> None < 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'NoneType' and 'int'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)