andz icon indicating copy to clipboard operation
andz copied to clipboard

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

Open nbro opened this issue 3 years ago • 0 comments

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.

nbro avatar Dec 30 '20 13:12 nbro