nbro / andz

Algorithms and data structures for educational, demonstrational and experimental purposes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the type hint "None" to "NoneType" (which is the actual type)

nbro opened this issue · comments

commented

None is an object of type NoneType. However, in many cases, I specify that the type of parameter or return value is None, but this latter is an object, so this is wrong. To use NoneType, we could do as follows

NoneType = type(None)

Edit: I just found out this: https://www.python.org/dev/peps/pep-0484/#using-none. How stupid is it? Only because None is the only object of NoneType, it doesn't make it the class itself.