IceSpringPySideStubs icon indicating copy to clipboard operation
IceSpringPySideStubs copied to clipboard

BUG: Use of `NoneType` in Python 3.0 to 3.9 Creates Errors

Open adam-grant-hendry opened this issue 3 years ago • 0 comments

NoneType was removed from types in python versions 3.0 to 3.9, but placed back in version 3.10 for type checking.

In versions < 3.10, using NoneType implicitly in the IceSpring stubs causes pylance to report a "partially unknown" error on functions that use it because mypy registers this as an Unknown type.

The solution is to use

NoneType = type(None)

throughout as that is, quite literally, what the value of NoneType is defined to be.

Thank you for the great package!

FYI: See also this SO post

adam-grant-hendry avatar Jun 15 '22 22:06 adam-grant-hendry