sourceperl / pyModbusTCP

A simple Modbus/TCP library for Python
MIT License
307 stars 106 forks source link

Fix for static typechecking misinterpreting types. #63

Closed Nedok closed 1 year ago

Nedok commented 1 year ago

Set default values for internal values to allow static typechecking a better chance to give the correct values. (VS code gives None | correct_type)

Minimal change I can make without actually adding typing to all functions.

sourceperl commented 1 year ago

I just tested ModbusClient with VS Code 1.76.0 and the type checking switch enabled, everything seems fine. Maybe a problem has been solved in Pylance.